From 2cfef1ac62b6f5b9cfeeda4f4619005d223c65a5 Mon Sep 17 00:00:00 2001 From: Kevin Cali <20154415+kevincali@users.noreply.github.com> Date: Wed, 15 May 2024 11:00:13 +0200 Subject: [PATCH] feat: disable notifications --- telegram.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/telegram.go b/telegram.go index 64088d0..c4fd2b1 100644 --- a/telegram.go +++ b/telegram.go @@ -35,12 +35,18 @@ func (config *Config) initMessage(bot *tgbotapi.BotAPI, configPath string) { log.Printf("no messageId specified in config") // send message - initChattable := tgbotapi.NewMessage(config.Telegram.ChatId, "init") + initChattable := tgbotapi.MessageConfig{ + BaseChat: tgbotapi.BaseChat{ + ChatID: config.Telegram.ChatId, + DisableNotification: true, + }, + Text: "init", + } initMsg, err := bot.Send(initChattable) if err != nil { log.Fatal(err) } - log.Printf("%s sent message", tgPrefix) + log.Printf("%s sent init message", tgPrefix) // save messageId to config config.Telegram.MessageId = initMsg.MessageID @@ -60,7 +66,7 @@ func (config *Config) initMessage(bot *tgbotapi.BotAPI, configPath string) { ChatID: config.Telegram.ChatId, ChannelUsername: "", MessageID: config.Telegram.MessageId, - DisableNotification: false, + DisableNotification: true, } bot.Send(pinConfig) log.Printf("%s pinned message", tgPrefix)