This commit is contained in:
2026-02-03 16:41:34 +03:00
parent 90e2f38c18
commit c71aad0c79
5 changed files with 97 additions and 0 deletions

View File

@@ -76,6 +76,10 @@ func (ctx *MsgContext) editPhotoText(messageId int, text string, kb *InlineKeybo
}
}
func (m *AnswerMessage) EditCaption(text string) *AnswerMessage {
if m.MessageID == 0 {
m.ctx.Bot.logger.Errorln("Can't edit caption message, message id is zero")
return m
}
return m.ctx.editPhotoText(m.MessageID, text, nil)
}
func (m *AnswerMessage) EditCaptionKeyboard(text string, kb *InlineKeyboard) *AnswerMessage {
@@ -124,6 +128,9 @@ func (ctx *MsgContext) answerPhoto(photoId, text string, kb *InlineKeyboard) *An
msg, err := ctx.Bot.SendPhoto(params)
if err != nil {
ctx.Bot.logger.Errorln(err)
return &AnswerMessage{
ctx: ctx, Text: text, IsMedia: true,
}
}
return &AnswerMessage{
MessageID: msg.MessageID, ctx: ctx, Text: text, IsMedia: true,