This commit is contained in:
dela
2026-02-04 22:33:45 +08:00
commit d82badc6e3
16 changed files with 2261 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
package telegram
import (
tele "gopkg.in/telebot.v3"
)
func (b *Bot) AdminMiddleware() tele.MiddlewareFunc {
return func(next tele.HandlerFunc) tele.HandlerFunc {
return func(c tele.Context) error {
if !b.cfg.IsAdmin(c.Sender().ID) {
return c.Reply("⛔ 无权限访问")
}
return next(c)
}
}
}