From ba110d116a855ec0eb85940a2dee964e870b274f Mon Sep 17 00:00:00 2001 From: mput Date: Wed, 24 Jul 2024 10:29:06 +0100 Subject: [PATCH] Change messages markup --- app/bot/bot.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/app/bot/bot.go b/app/bot/bot.go index 1917df2..78783d9 100644 --- a/app/bot/bot.go +++ b/app/bot/bot.go @@ -163,7 +163,11 @@ func start(_ *ext.Context) (string, *gotgbot.SendMessageOpts, error) { } func (bot *Bot) vesrion(_ *ext.Context) (string, *gotgbot.SendMessageOpts, error) { - return fmt.Sprintf("teledger v: %s", bot.opts.Version), nil, nil + return fmt.Sprintf("teledger v: %s", bot.opts.Version), + &gotgbot.SendMessageOpts{ + DisableNotification: true, + }, + nil } @@ -183,7 +187,10 @@ func (bot *Bot) comment(ctx *ext.Context) (string, *gotgbot.SendMessageOpts, err return fmt.Sprintf("Error: %v", err), nil, nil } - return fmt.Sprintf("```\n%s\n```", comment), &gotgbot.SendMessageOpts{ParseMode: "MarkdownV2"}, nil + return fmt.Sprintf("```\n%s\n```", comment), &gotgbot.SendMessageOpts{ + ParseMode: "MarkdownV2", + DisableNotification: true, + }, nil } //go:embed templates/propose_transaction.html @@ -214,7 +221,7 @@ func (bot *Bot) proposeTransaction(ctx *ext.Context) (string, *gotgbot.SendMessa return buf.String(), &gotgbot.SendMessageOpts{ ParseMode: "HTML", - ReplyParameters: &gotgbot.ReplyParameters{MessageId: msg.MessageId}, + // ReplyParameters: &gotgbot.ReplyParameters{MessageId: msg.MessageId}, DisableNotification: true, ReplyMarkup: gotgbot.InlineKeyboardMarkup{ InlineKeyboard: inlineKeyboard, @@ -239,6 +246,7 @@ func (bot *Bot) showAvailableReports(_ *ext.Context) (string, *gotgbot.SendMessa opts := &gotgbot.SendMessageOpts{ ParseMode: "MarkdownV2", + DisableNotification: true, ReplyMarkup: gotgbot.InlineKeyboardMarkup{ InlineKeyboard: inlineKeyboard, }, @@ -357,5 +365,8 @@ func (bot *Bot) showReport(ctx *ext.Context) (string, *gotgbot.SendMessageOpts, return fmt.Sprintf("Error: %v", err), nil, nil } - return fmt.Sprintf("```\n%s\n```", report), &gotgbot.SendMessageOpts{ParseMode: "MarkdownV2"}, nil + return fmt.Sprintf("```\n%s\n```", report), &gotgbot.SendMessageOpts{ + ParseMode: "MarkdownV2", + DisableNotification: true, + }, nil }