Add DeclineChatJoinRequest on ban

This commit is contained in:
Astra 2026-03-01 21:00:46 +00:00
parent 91c876b35b
commit 4e71c09c5a

View file

@ -120,6 +120,17 @@ func (bot *Bot) handleBanRequest(query *api.CallbackQuery, user *ExtendedChatJoi
return
}
declineRequest := api.DeclineChatJoinRequest{
ChatConfig: api.ChatConfig{ChatID: user.ChatJoinRequest.Chat.ID},
UserID: user.ChatJoinRequest.From.ID,
}
if _, err := bot.API.Request(declineRequest); err != nil {
log.Println(err)
bot.restoreMessage(query)
return
}
bannedUntil := time.Now().Add(24 * time.Hour).Format("2006-01-02 15:04:05")
utils.EditMessage(bot.API, query.Message.Chat.ID, query.Message.MessageID,
fmt.Sprintf(AdminBannedMsg,