Compare commits

...

1 Commits

Author SHA1 Message Date
Aaron Johnon 813507567b Added -p flag to allow changing the bot message parse mode
6 months ago

@ -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,

Loading…
Cancel
Save