mirror of
https://github.com/fumiama/ReiBot.git
synced 2026-06-06 01:20:24 +08:00
19 lines
395 B
Go
19 lines
395 B
Go
package echo
|
|
|
|
import (
|
|
rei "github.com/fumiama/ReiBot"
|
|
tgba "github.com/go-telegram-bot-api/telegram-bot-api/v5"
|
|
)
|
|
|
|
func init() {
|
|
rei.OnMessagePrefix("echo").SetBlock(true).SecondPriority().
|
|
Handle(func(ctx *rei.Ctx) {
|
|
args := ctx.State["args"].(string)
|
|
if args == "" {
|
|
return
|
|
}
|
|
msg := ctx.Value.(*tgba.Message)
|
|
ctx.Caller.Send(tgba.NewMessage(msg.Chat.ID, args))
|
|
})
|
|
}
|