mirror of
https://github.com/fumiama/NanoBot.git
synced 2026-06-05 18:50:24 +08:00
25 lines
584 B
Go
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"},
|
|
})
|
|
}
|