Skip to content

Commit 477e770

Browse files
committed
fix: update gotgbot to v2-rc.30
1 parent 948c724 commit 477e770

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

internal/bot/pricehistory.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ func showPriceHistoryHandler(bot *gotgbot.Bot, ctx *ext.Context) error {
5757
_, _ = bot.DeleteMessage(ctx.EffectiveChat.Id, cbq.Message.GetMessageId(), nil)
5858

5959
editedText := fmt.Sprintf("%s\nFür welchen Zeitraum möchtest du die Preishistorie sehen?", bold(createLink(priceagent.EntityURL(), priceagent.Name)))
60-
_, sendErr := bot.SendPhoto(ctx.EffectiveUser.Id, buffer, &gotgbot.SendPhotoOpts{Caption: editedText, ReplyMarkup: markup, ParseMode: "HTML"})
60+
inputFile := gotgbot.InputFileByReader("chart.png", buffer)
61+
_, sendErr := bot.SendPhoto(ctx.EffectiveUser.Id, inputFile, &gotgbot.SendPhotoOpts{Caption: editedText, ReplyMarkup: markup, ParseMode: "HTML"})
6162
if sendErr != nil {
6263
return fmt.Errorf("showPriceagentDetail: failed to send photo: %w", sendErr)
6364
}
@@ -117,7 +118,8 @@ func updatePriceHistoryGraphHandler(bot *gotgbot.Bot, ctx *ext.Context) error {
117118
renderChart(priceagent, history, since, buffer, darkMode)
118119

119120
caption := fmt.Sprintf("%s\nFür welchen Zeitraum möchtest du die Preishistorie sehen?", bold(createLink(priceagent.EntityURL(), priceagent.Name)))
120-
newPic := gotgbot.InputMediaPhoto{Media: buffer, Caption: caption, ParseMode: "HTML"}
121+
inputFile := gotgbot.InputFileByReader("chart.png", buffer)
122+
newPic := gotgbot.InputMediaPhoto{Media: inputFile, Caption: caption, ParseMode: "HTML"}
121123
_, _, sendErr := cbq.Message.EditMedia(bot, newPic, &gotgbot.EditMessageMediaOpts{ReplyMarkup: markup})
122124
if sendErr != nil {
123125
return fmt.Errorf("updatePriceHistoryGraphHandler: failed to send photo: %w", sendErr)

0 commit comments

Comments
 (0)