Package for «Keksik» API in VK Mini App
go get github.com/aejoy/keksikgo
package main
import (
"fmt"
"os"
"github.com/aejoy/keksikgo/api"
)
func main() {
app := api.New(os.Getenv("TOKEN"), 123)
fmt.Println(app.Balance())
}
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"))
}