diff --git a/bot.go b/bot.go index 39037b8d..a6f8499d 100644 --- a/bot.go +++ b/bot.go @@ -343,6 +343,13 @@ func (bot *BotAPI) Send(c Chattable) (Message, error) { return Message{}, err } + switch c.(type) { + case *DeleteMessageConfig: + return Message{}, nil + default: + break + } + var message Message err = json.Unmarshal(resp.Result, &message) diff --git a/types.go b/types.go index 36c174b8..e63a8c3d 100644 --- a/types.go +++ b/types.go @@ -51,6 +51,11 @@ type Update struct { // // optional EditedMessage *Message `json:"edited_message,omitempty"` + // MessageReaction message indicating a user react event to a chat + // administrated by the bot + // + // optional + MessageReaction *Message `json:"message_reaction,omitempty"` // ChannelPost new version of a message that is known to the bot and was // edited // @@ -365,6 +370,10 @@ type Message struct { // // optional From *User `json:"from,omitempty"` + // User is the subject of an atypical Update type, such as message_reaction; + // + // optional + User *User `json:"user,omitempty"` // SenderChat is the sender of the message, sent on behalf of a chat. The // channel itself for channel messages. The supergroup itself for messages // from anonymous group administrators. The linked channel for messages @@ -634,6 +643,14 @@ type Message struct { // // optional ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` + // OldReaction is the previous list of reacts for this User and Message. + // + // optional + OldReaction []*ReactionType `json:"old_reaction,omitempty"` + // NewReaction is the updated list of reacts for this User and Message. + // + // optional + NewReaction []*ReactionType `json:"new_reaction,omitempty"` } // Time converts the message timestamp into a Time. @@ -3328,3 +3345,12 @@ type PreCheckoutQuery struct { // optional OrderInfo *OrderInfo `json:"order_info,omitempty"` } + +type ReactionType struct { + // The type of reaction, can be on of 'emoji', 'custom_emoji', 'paid' + Type string `json:"type,omitempty"` + // If type is 'emoji', specifies its unicode + Emoji string `json:"emoji,omitempty"` + // If type is 'custom_emoji', specifies its unique ID + CustomEmojiID string `json:"custom_emoji_id,omitempty"` +}