From 813507567bc78ce0d08c94eeea839f860120d38c Mon Sep 17 00:00:00 2001 From: Aaron Johnon Date: Tue, 18 Mar 2025 18:56:37 -0500 Subject: [PATCH] Added -p flag to allow changing the bot message parse mode --- tbotsend.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tbotsend.go b/tbotsend.go index 23095be..287d310 100644 --- a/tbotsend.go +++ b/tbotsend.go @@ -29,6 +29,7 @@ var ( configFile string chatID string token string + parse_mode string timeout int silent bool versionFlag bool @@ -39,6 +40,7 @@ func init() { pflag.StringVarP(&configFile, "config", "f", "", "Configuration file path") pflag.StringVarP(&chatID, "chatid", "c", "", "Chat ID value") pflag.StringVarP(&token, "token", "t", "", "Bot token value") + pflag.StringVarP(&parse_mode, "parse", "p", "MarkdownV2", "Telegram message parse mode") pflag.IntVarP(&timeout, "timeout", "", 10, "Timeout value") pflag.BoolVarP(&silent, "silent", "s", false, "Disable notification sound") pflag.BoolVarP(&versionFlag, "version", "v", false, "Print version information and exit") @@ -155,6 +157,7 @@ func main() { data.Set("disable_notification", "true") } data.Set("text", message) + data.Set("parse_mode", parse_mode) client := &http.Client{ Timeout: time.Duration(config.Timeout) * time.Second,