1
0
mirror of https://github.com/fumiama/ReiBot.git synced 2026-06-06 09:30:25 +08:00
Files
ReiBot/example/main.go
源文雨 131fd9727c add more
2022-06-02 19:33:20 +08:00

27 lines
521 B
Go

package main
import (
_ "github.com/fumiama/ReiBot/example/echo"
rei "github.com/fumiama/ReiBot"
tgba "github.com/go-telegram-bot-api/telegram-bot-api/v5"
)
func main() {
rei.OnMessageFullMatch("help").SetBlock(true).
Handle(func(ctx *rei.Ctx) {
msg := ctx.Value.(*tgba.Message)
_, _ = ctx.Caller.Send(tgba.NewMessage(msg.Chat.ID, "echo string"))
})
rei.Run(rei.Bot{
Token: "",
Buffer: 256,
UpdateConfig: tgba.UpdateConfig{
Offset: 0,
Limit: 0,
Timeout: 60,
},
Debug: true,
})
}