Skip to content

Commit fbcad99

Browse files
fix(userbot): re-promoting admins
1 parent cbd74b2 commit fbcad99

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/bot/userbot.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,17 @@ func (u *UserBotStruct) AddBotsAsAdmins() error {
8585
}
8686
}
8787
for _, bot := range Workers.Bots {
88+
isAdmin := false
8889
for _, admin := range currentAdmins {
8990
if admin == bot.Self.ID {
9091
u.log.Sugar().Infof("Bot @%s is already an admin", bot.Self.Username)
92+
isAdmin = true
9193
continue
9294
}
9395
}
96+
if isAdmin {
97+
continue
98+
}
9499
botInfo, err := ctx.ResolveUsername(bot.Self.Username)
95100
if err != nil {
96101
u.log.Warn(err.Error())

0 commit comments

Comments
 (0)