1
0
mirror of https://github.com/fumiama/NanoBot.git synced 2026-06-05 18:50:24 +08:00
Files
NanoBot/example/main.go
2023-11-22 21:42:08 +09:00

25 lines
600 B
Go

package main
import (
_ "github.com/fumiama/NanoBot/example/echo"
nano "github.com/fumiama/NanoBot"
log "github.com/sirupsen/logrus"
)
func main() {
log.SetLevel(log.DebugLevel)
nano.OpenAPI = nano.SandboxAPI
nano.OnMessageFullMatch("help").SetBlock(true).
Handle(func(ctx *nano.Ctx) {
_, _ = ctx.SendPlainMessage(false, "echo string")
})
nano.Run(nil, &nano.Bot{
AppID: "你的AppID",
Token: "你的Token",
Secret: "你的Secret, 可以不填 (QQ群Bot必须填写)",
Intents: nano.IntentGuildPublic,
SuperUsers: []string{"用户ID1", "用户ID2"},
})
}