v1.0.0 beta 12

This commit is contained in:
2026-03-12 14:02:32 +03:00
parent 7e12e0a9f9
commit b1b0cbdfbd
17 changed files with 1410 additions and 308 deletions

28
examples/basic/example.go Normal file
View File

@@ -0,0 +1,28 @@
package main
import (
"log"
"git.nix13.pw/scuroneko/laniakea"
)
func pong(ctx *laniakea.MsgContext, db *laniakea.NoDB) {
ctx.Answer(ctx.Msg.Text)
}
func main() {
bot := laniakea.NewBot[laniakea.NoDB](laniakea.LoadOptsFromEnv())
defer bot.Close()
p := laniakea.NewPlugin[laniakea.NoDB]("ping")
p.NewCommand(pong, "ping")
bot = bot.ErrorTemplate(
"Error\n\n%s",
).AddPlugins(p)
if err := bot.AutoGenerateCommands(); err != nil {
log.Println(err)
}
bot.Run()
}