summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-telegram-bot-api/telegram-bot-api/configs.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/go-telegram-bot-api/telegram-bot-api/configs.go')
-rw-r--r--vendor/github.com/go-telegram-bot-api/telegram-bot-api/configs.go80
1 files changed, 75 insertions, 5 deletions
diff --git a/vendor/github.com/go-telegram-bot-api/telegram-bot-api/configs.go b/vendor/github.com/go-telegram-bot-api/telegram-bot-api/configs.go
index c0293ce2..574b3dd9 100644
--- a/vendor/github.com/go-telegram-bot-api/telegram-bot-api/configs.go
+++ b/vendor/github.com/go-telegram-bot-api/telegram-bot-api/configs.go
@@ -676,7 +676,7 @@ type SetGameScoreConfig struct {
Score int
Force bool
DisableEditMessage bool
- ChatID int
+ ChatID int64
ChannelUsername string
MessageID int
InlineMessageID string
@@ -689,7 +689,7 @@ func (config SetGameScoreConfig) values() (url.Values, error) {
v.Add("score", strconv.Itoa(config.Score))
if config.InlineMessageID == "" {
if config.ChannelUsername == "" {
- v.Add("chat_id", strconv.Itoa(config.ChatID))
+ v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
} else {
v.Add("chat_id", config.ChannelUsername)
}
@@ -1038,8 +1038,8 @@ func (config DeleteMessageConfig) values() (url.Values, error) {
// PinChatMessageConfig contains information of a message in a chat to pin.
type PinChatMessageConfig struct {
- ChatID int64
- MessageID int
+ ChatID int64
+ MessageID int
DisableNotification bool
}
@@ -1072,4 +1072,74 @@ func (config UnpinChatMessageConfig) values() (url.Values, error) {
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
return v, nil
-} \ No newline at end of file
+}
+
+// SetChatTitleConfig contains information for change chat title.
+type SetChatTitleConfig struct {
+ ChatID int64
+ Title string
+}
+
+func (config SetChatTitleConfig) method() string {
+ return "setChatTitle"
+}
+
+func (config SetChatTitleConfig) values() (url.Values, error) {
+ v := url.Values{}
+
+ v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
+ v.Add("title", config.Title)
+
+ return v, nil
+}
+
+// SetChatDescriptionConfig contains information for change chat description.
+type SetChatDescriptionConfig struct {
+ ChatID int64
+ Description string
+}
+
+func (config SetChatDescriptionConfig) method() string {
+ return "setChatDescription"
+}
+
+func (config SetChatDescriptionConfig) values() (url.Values, error) {
+ v := url.Values{}
+
+ v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
+ v.Add("description", config.Description)
+
+ return v, nil
+}
+
+// SetChatPhotoConfig contains information for change chat photo
+type SetChatPhotoConfig struct {
+ BaseFile
+}
+
+// name returns the field name for the Photo.
+func (config SetChatPhotoConfig) name() string {
+ return "photo"
+}
+
+// method returns Telegram API method name for sending Photo.
+func (config SetChatPhotoConfig) method() string {
+ return "setChatPhoto"
+}
+
+// DeleteChatPhotoConfig contains information for delete chat photo.
+type DeleteChatPhotoConfig struct {
+ ChatID int64
+}
+
+func (config DeleteChatPhotoConfig) method() string {
+ return "deleteChatPhoto"
+}
+
+func (config DeleteChatPhotoConfig) values() (url.Values, error) {
+ v := url.Values{}
+
+ v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
+
+ return v, nil
+}