From 9fd1f7e399b98750ec9d7174dd78d01203a32714 Mon Sep 17 00:00:00 2001 From: Etherdrake <67021215+Etherdrake@users.noreply.github.com> Date: Wed, 14 Feb 2024 12:35:58 -0500 Subject: [PATCH] Added NewDeleteMessages method to batch DeleteMessage requests within the same chat, create object and call bot.Request(object) --- helper_methods.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/helper_methods.go b/helper_methods.go index 99079f7..93901d9 100644 --- a/helper_methods.go +++ b/helper_methods.go @@ -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 // by username. //