Skip to content

Commit 14de1ce

Browse files
committed
Error handling from GetChatAdministrators
1 parent bad30f7 commit 14de1ce

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ func main() {
3131
message := ""
3232

3333
admins, _ := bot.GetChatAdministrators(tgbotapi.ChatAdministratorsConfig{ChatConfig: update.Message.Chat.ChatConfig()})
34+
if err != nil {
35+
log.Printf("GetChatAdministrators error: %v", err)
36+
37+
continue
38+
}
3439

3540
for _, admin := range admins {
3641
if admin.User.ID == update.Message.From.ID {

0 commit comments

Comments
 (0)