Archived
1

Add battle announces to channel

Channel ID is configured in fw_zookeeper.yaml.
This commit is contained in:
2018-11-29 22:15:21 +04:00
parent eeee9a72e3
commit 0ba20b3ed5
7 changed files with 83 additions and 2 deletions

View File

@@ -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)
}
}

View File

@@ -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)
}
}