Add warning for stickers

This commit is contained in:
2024-08-07 14:35:17 +03:00
parent e886a22046
commit aabc012c6b
3 changed files with 45 additions and 22 deletions
+15 -3
View File
@@ -76,9 +76,10 @@ func (api *botAPI) hydrateMessage(msg *tgbotapi.Message) app.Message {
}
return app.Message{
Text: text,
Image: api.hydrateImage(msg.Photo),
Video: api.hydrateVideo(msg.Video),
Text: text,
Image: api.hydrateImage(msg.Photo),
Video: api.hydrateVideo(msg.Video),
Sticker: api.hydrateSticker(msg.Sticker),
}
}
@@ -159,6 +160,17 @@ func (api *botAPI) hydrateVideo(video *tgbotapi.Video) *app.Video {
}
}
func (api *botAPI) hydrateSticker(sticker *tgbotapi.Sticker) *app.Sticker {
if sticker == nil {
return nil
}
return &app.Sticker{
FileID: sticker.FileID,
Emoji: sticker.Emoji,
}
}
func (api *botAPI) preparePhotos(message app.Message) []interface{} {
photo := tgbotapi.NewInputMediaPhoto(tgbotapi.FileID(message.Image.FileID))
photo.Caption = message.Text