|
|
|
@ -1035,3 +1035,41 @@ func (config DeleteMessageConfig) values() (url.Values, error) { |
|
|
|
|
|
|
|
|
|
return v, nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// PinChatMessageConfig contains information of a message in a chat to pin.
|
|
|
|
|
type PinChatMessageConfig struct { |
|
|
|
|
ChatID int64 |
|
|
|
|
MessageID int |
|
|
|
|
DisableNotification bool |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (config PinChatMessageConfig) method() string { |
|
|
|
|
return "pinChatMessage" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (config PinChatMessageConfig) values() (url.Values, error) { |
|
|
|
|
v := url.Values{} |
|
|
|
|
|
|
|
|
|
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10)) |
|
|
|
|
v.Add("message_id", strconv.Itoa(config.MessageID)) |
|
|
|
|
v.Add("disable_notification", strconv.FormatBool(config.DisableNotification)) |
|
|
|
|
|
|
|
|
|
return v, nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UnpinChatMessageConfig contains information of chat to unpin.
|
|
|
|
|
type UnpinChatMessageConfig struct { |
|
|
|
|
ChatID int64 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (config UnpinChatMessageConfig) method() string { |
|
|
|
|
return "unpinChatMessage" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (config UnpinChatMessageConfig) values() (url.Values, error) { |
|
|
|
|
v := url.Values{} |
|
|
|
|
|
|
|
|
|
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10)) |
|
|
|
|
|
|
|
|
|
return v, nil |
|
|
|
|
} |