Add battle announces to channel
Channel ID is configured in fw_zookeeper.yaml.
This commit is contained in:
@@ -24,3 +24,26 @@ func RespondWithMarkdown(chatID int64, message string) {
|
||||
log.Error().Err(err)
|
||||
}
|
||||
}
|
||||
|
||||
// RespondWithoutMarkdown will send message to given chat without parse mode
|
||||
func RespondWithoutMarkdown(chatID int64, message string) {
|
||||
messageParams := getMessageParams(chatID, message, false)
|
||||
messageParams.ParseMode = "HTML"
|
||||
|
||||
_, err := bot.SendMessage(&messageParams)
|
||||
if err != nil {
|
||||
log.Error().Err(err)
|
||||
}
|
||||
}
|
||||
|
||||
// RespondWithInlineKeyboard will send message to given chat with Markdown parse
|
||||
// mode and keyboard attached
|
||||
func RespondWithInlineKeyboard(chatID int64, message string, keyboard *telegram.InlineKeyboardMarkup) {
|
||||
messageParams := getMessageParams(chatID, message, false)
|
||||
messageParams.ReplyMarkup = keyboard
|
||||
|
||||
_, err := bot.SendMessage(&messageParams)
|
||||
if err != nil {
|
||||
log.Error().Err(err)
|
||||
}
|
||||
}
|
||||
|
@@ -90,7 +90,6 @@ func StartBot() {
|
||||
log.Info().Msg("Connection with Telegram established")
|
||||
|
||||
for update := range updates {
|
||||
log.Debug().Msgf("%+v", update)
|
||||
go router.Respond(update)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user