Skip to content
/ keksikgo Public

🧁 Package for the «Keksik» API in VK Mini App

License

Notifications You must be signed in to change notification settings

aejoy/keksikgo

Repository files navigation

Package for «Keksik» API in VK Mini App

Installation

go get github.com/aejoy/keksikgo

Usage

Methods

package main

import (
    "fmt"
    "os"

    "github.com/aejoy/keksikgo/api"
)

func main() {
    app := api.New(os.Getenv("TOKEN"), 123)
    fmt.Println(app.Balance())
}

Callback

package main

import (
    "fmt"
    "log"
    "os"

    "github.com/aejoy/keksikgo/api"
    "github.com/aejoy/keksikgo/callback"
    "github.com/aejoy/keksikgo/update"
    "github.com/gofiber/fiber/v3"
    "go.uber.org/zap"
)

func main() {
    logger, err := zap.NewProduction()
    if err != nil {
        panic(err)
    }

    cake := api.New(123, os.Getenv("TOKEN"), logger)

    app := fiber.New()
    session := callback.New(cake)

    session.Donate(func(_ *api.API, donate update.Donate) {
        fmt.Printf("New donate: %+v\n", donate)
    })

    app.Post("/callback/:confirmation", session.Fiber)

    log.Fatalln(app.Listen(":3000"))
}

About

🧁 Package for the «Keksik» API in VK Mini App

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages