Vladimir Hodakov
5820a37326
This commit may be used as template for making any new Telegram bots. Just check out it, change your variables and start developing new shiny bot! Maybe I need to create bot generator...
27 lines
736 B
Go
27 lines
736 B
Go
// Fantasy World Zookeeper Bot
|
|
// Copyright (c) 2018 Vladimir "fat0troll" Hodakov
|
|
|
|
package telegram
|
|
|
|
import (
|
|
"gitlab.com/toby3d/telegram"
|
|
)
|
|
|
|
func getMessageParams(chatID int64, message string, disableWebPagePreview bool) telegram.SendMessageParameters {
|
|
return telegram.SendMessageParameters{
|
|
ChatID: chatID,
|
|
Text: message,
|
|
ParseMode: "Markdown",
|
|
DisableWebPagePreview: disableWebPagePreview}
|
|
}
|
|
|
|
// RespondWithMarkdown will send message to given chat with Markdown parse mode
|
|
func RespondWithMarkdown(chatID int64, message string) {
|
|
messageParams := getMessageParams(chatID, message, false)
|
|
|
|
_, err := bot.SendMessage(&messageParams)
|
|
if err != nil {
|
|
log.Error().Err(err)
|
|
}
|
|
}
|