diff --git a/configs.go b/configs.go index aff0cd9..ab03450 100644 --- a/configs.go +++ b/configs.go @@ -697,6 +697,22 @@ type EditMessageTextConfig struct { DisableWebPagePreview bool } +type DeleteMessageConfig struct { + ChatID int64 `json:"chat_id"` + MessageID int `json:"message_id"` +} + +func (config DeleteMessageConfig) values() (url.Values, error) { + v := url.Values{} + v.Add("chat_id", strconv.FormatInt(config.ChatID, 10)) + v.Add("message_id", strconv.FormatInt(int64(config.MessageID), 10)) + return v, nil +} + +func (config DeleteMessageConfig) method() string { + return "deleteMessage" +} + func (config EditMessageTextConfig) values() (url.Values, error) { v, err := config.BaseEdit.values() if err != nil { diff --git a/helpers.go b/helpers.go index 476eeeb..25f2fc1 100644 --- a/helpers.go +++ b/helpers.go @@ -19,6 +19,13 @@ func NewMessage(chatID int64, text string) MessageConfig { } } +func NewDeleteMessage(chatID int64, messageID int) DeleteMessageConfig { + return DeleteMessageConfig{ + ChatID: chatID, + MessageID: messageID, + } +} + // NewMessageToChannel creates a new Message that is sent to a channel // by username. //