Added NewDeleteMessages method to batch DeleteMessage requests within the same chat, create object and call bot.Request(object)

pull/15/head
Etherdrake 2024-02-14 12:35:58 -05:00
parent 63e5c59035
commit 9fd1f7e399
No known key found for this signature in database
GPG Key ID: 8BEA7D89AE87F4B9
1 changed files with 13 additions and 0 deletions

View File

@ -40,6 +40,19 @@ func NewDeleteMessage(chatID int64, messageID int) DeleteMessageConfig {
} }
} }
// NewDeleteMessages creates a request to delete multiple messages. The messages have to be
// in the same chat. Provide the message ids as an array of integers
func NewDeleteMessages(chatID int64, messageIDs []int) DeleteMessagesConfig {
return DeleteMessagesConfig{
BaseChatMessages: BaseChatMessages{
ChatConfig: ChatConfig{
ChatID: chatID,
},
MessageIDs: messageIDs,
},
}
}
// NewMessageToChannel creates a new Message that is sent to a channel // NewMessageToChannel creates a new Message that is sent to a channel
// by username. // by username.
// //