1
0
mirror of https://github.com/fumiama/NanoBot.git synced 2026-06-06 03:00:24 +08:00
Files
NanoBot/example/main.go
源文雨 ce34c996ef finish
2023-10-16 00:26:04 +09:00

25 lines
584 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(&nano.Bot{
AppID: "你的AppID",
Token: "你的Token",
Secret: "你的Secret, 目前没用到, 可以不填",
Intents: nano.IntentPublic,
SuperUsers: []string{"用户ID1", "用户ID2"},
})
}