Add DeclineChatJoinRequest on ban
This commit is contained in:
parent
91c876b35b
commit
4e71c09c5a
1 changed files with 11 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue