Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab822c2fe6 | ||
|
|
2579044841 |
@@ -46,7 +46,7 @@ const noPermissionText string = `
|
||||
|
||||
func checkPermission(ctx *ext.Context, update *ext.Update) error {
|
||||
userID := update.GetUserChat().GetID()
|
||||
if !slice.Contain(config.Cfg.Telegram.Admins, userID) {
|
||||
if !slice.Contain(config.Cfg.GetUsersID(), userID) {
|
||||
ctx.Reply(update, ext.ReplyTextString(noPermissionText), nil)
|
||||
return dispatcher.EndGroups
|
||||
}
|
||||
|
||||
@@ -40,7 +40,9 @@ func Init() {
|
||||
logger.L.Fatal("迁移数据库失败, 如果您从旧版本升级, 建议手动删除数据库文件后重试: ", err)
|
||||
}
|
||||
|
||||
for _, admin := range config.Cfg.Telegram.Admins {
|
||||
CreateUser(int64(admin))
|
||||
for _, admin := range config.Cfg.GetUsersID() {
|
||||
if err := CreateUser(int64(admin)); err != nil {
|
||||
logger.L.Fatal("Failed to create admin user: ", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user