diff options
author | Wim <wim@42.be> | 2017-01-27 00:23:14 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2017-01-27 00:23:14 +0100 |
commit | 077d494c7bd6fc0b8c2fa1c537cccd7959d0f201 (patch) | |
tree | 26ac6e0289438daa6fca125e474e80ecc7643cb8 /vendor/github.com/go-telegram-bot-api/telegram-bot-api/helpers.go | |
parent | 09b243d8c2b4276de268777d973ca618267db92c (diff) | |
download | matterbridge-msglm-077d494c7bd6fc0b8c2fa1c537cccd7959d0f201.tar.gz matterbridge-msglm-077d494c7bd6fc0b8c2fa1c537cccd7959d0f201.tar.bz2 matterbridge-msglm-077d494c7bd6fc0b8c2fa1c537cccd7959d0f201.zip |
Update vendor (telegram)
Diffstat (limited to 'vendor/github.com/go-telegram-bot-api/telegram-bot-api/helpers.go')
-rw-r--r-- | vendor/github.com/go-telegram-bot-api/telegram-bot-api/helpers.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/vendor/github.com/go-telegram-bot-api/telegram-bot-api/helpers.go b/vendor/github.com/go-telegram-bot-api/telegram-bot-api/helpers.go index 53e50052..4ca56fbf 100644 --- a/vendor/github.com/go-telegram-bot-api/telegram-bot-api/helpers.go +++ b/vendor/github.com/go-telegram-bot-api/telegram-bot-api/helpers.go @@ -1,6 +1,7 @@ package tgbotapi import ( + "log" "net/url" ) @@ -20,6 +21,7 @@ func NewMessage(chatID int64, text string) MessageConfig { // NewMessageToChannel creates a new Message that is sent to a channel // by username. +// // username is the username of the channel, text is the message text. func NewMessageToChannel(username string, text string) MessageConfig { return MessageConfig{ @@ -316,6 +318,21 @@ func NewWebhookWithCert(link string, file interface{}) WebhookConfig { } } +// NewWebhookWithCert creates a new webhook with a certificate and max_connections. +// +// link is the url you wish to get webhooks, +// file contains a string to a file, FileReader, or FileBytes. +// maxConnections defines maximum number of connections from telegram to your server +func NewWebhookWithCertAndMaxConnections(link string, file interface{}, maxConnections int) WebhookConfig { + u, _ := url.Parse(link) + + return WebhookConfig{ + URL: u, + Certificate: file, + MaxConnections: maxConnections, + } +} + // NewInlineQueryResultArticle creates a new inline query article. func NewInlineQueryResultArticle(id, title, messageText string) InlineQueryResultArticle { return InlineQueryResultArticle{ @@ -479,12 +496,23 @@ func NewEditMessageReplyMarkup(chatID int64, messageID int, replyMarkup InlineKe // NewHideKeyboard hides the keyboard, with the option for being selective // or hiding for everyone. func NewHideKeyboard(selective bool) ReplyKeyboardHide { + log.Println("NewHideKeyboard is deprecated, please use NewRemoveKeyboard") + return ReplyKeyboardHide{ HideKeyboard: true, Selective: selective, } } +// NewRemoveKeyboard hides the keyboard, with the option for being selective +// or hiding for everyone. +func NewRemoveKeyboard(selective bool) ReplyKeyboardRemove { + return ReplyKeyboardRemove{ + RemoveKeyboard: true, + Selective: selective, + } +} + // NewKeyboardButton creates a regular keyboard button. func NewKeyboardButton(text string) KeyboardButton { return KeyboardButton{ |