From 9db8f49c488d40344508f2eaab3a5dd17a1cac3b Mon Sep 17 00:00:00 2001 From: Syfaro Date: Thu, 25 Feb 2016 07:47:20 -0600 Subject: [PATCH] Add support for messages with disabled notifications. --- configs.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/configs.go b/configs.go index 19f4b18..1839a5d 100644 --- a/configs.go +++ b/configs.go @@ -63,10 +63,11 @@ type Fileable interface { // BaseChat is base type for all chat config types. type BaseChat struct { - ChatID int // required - ChannelUsername string - ReplyToMessageID int - ReplyMarkup interface{} + ChatID int // required + ChannelUsername string + ReplyToMessageID int + ReplyMarkup interface{} + DisableNotification bool } // values returns url.Values representation of BaseChat @@ -91,6 +92,8 @@ func (chat *BaseChat) values() (url.Values, error) { v.Add("reply_markup", string(data)) } + v.Add("disable_notification", strconv.FormatBool(chat.DisableNotification)) + return v, nil } @@ -135,6 +138,8 @@ func (file BaseFile) params() (map[string]string, error) { params["file_size"] = strconv.Itoa(file.FileSize) } + params["disable_notification"] = strconv.FormatBool(file.DisableNotification) + return params, nil }