Add set message reaction helpers.

This commit is contained in:
Ilja Lapkovskis 2024-01-20 18:17:17 +02:00
parent e41be9f718
commit a304e9002d
No known key found for this signature in database
GPG key ID: 53D2AA4F0D1079C4
3 changed files with 76 additions and 1 deletions

View file

@ -1141,3 +1141,31 @@ func ValidateWebAppData(token, telegramInitData string) (bool, error) {
return true, nil
}
func NewSetMessageReactionType(chatID int64, messageID int, reaction ReactionType, isBig bool) SetMessageReactionConfig {
return SetMessageReactionConfig{
BaseChatMessage: BaseChatMessage{
ChatConfig: ChatConfig{
ChatID: chatID,
},
MessageID: messageID,
},
Reaction: []ReactionType{reaction},
IsBig: isBig,
}
}
func NewSetMessageReactionEmoji(chatID int64, messageID int, reaction string, isBig bool) SetMessageReactionConfig {
return SetMessageReactionConfig{
BaseChatMessage: BaseChatMessage{
ChatConfig: ChatConfig{
ChatID: chatID,
},
MessageID: messageID,
},
Reaction: []ReactionType{
{Type: "emoji", Emoji: reaction},
},
IsBig: isBig,
}
}