Skip to content

Commit

Permalink
fix: use GetMessageId() func instead of MessageId attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
d-Rickyy-b committed May 30, 2024
1 parent f327683 commit d188868
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/bot/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func showPriceagentDetail(bot *gotgbot.Bot, ctx *ext.Context) error {
return fmt.Errorf("showPriceagentDetail: failed to edit message text: %w", err)
}
case Menu1:
bot.DeleteMessage(ctx.EffectiveChat.Id, cbq.Message.MessageId, nil)
bot.DeleteMessage(ctx.EffectiveChat.Id, cbq.Message.GetMessageId(), nil)

_, err := bot.SendMessage(ctx.EffectiveChat.Id, editedText, &gotgbot.SendMessageOpts{ReplyMarkup: markup, ParseMode: "HTML"})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/bot/pricehistory.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func showPriceHistoryHandler(bot *gotgbot.Bot, ctx *ext.Context) error {
buffer := bytes.NewBuffer([]byte{})
renderChart(priceagent, history, since, buffer, isDarkmode)

_, _ = bot.DeleteMessage(ctx.EffectiveChat.Id, cbq.Message.MessageId, nil)
_, _ = bot.DeleteMessage(ctx.EffectiveChat.Id, cbq.Message.GetMessageId(), nil)

editedText := fmt.Sprintf("%s\nFür welchen Zeitraum möchtest du die Preishistorie sehen?", bold(createLink(priceagent.EntityURL(), priceagent.Name)))
_, sendErr := bot.SendPhoto(ctx.EffectiveUser.Id, buffer, &gotgbot.SendPhotoOpts{Caption: editedText, ReplyMarkup: markup, ParseMode: "HTML"})
Expand Down

0 comments on commit d188868

Please sign in to comment.