Delete a message in a channel
parent
7434b0456e
commit
86a3d94b4b
|
@ -1138,6 +1138,7 @@ type PreCheckoutConfig struct {
|
||||||
|
|
||||||
// DeleteMessageConfig contains information of a message in a chat to delete.
|
// DeleteMessageConfig contains information of a message in a chat to delete.
|
||||||
type DeleteMessageConfig struct {
|
type DeleteMessageConfig struct {
|
||||||
|
ChannelUsername string
|
||||||
ChatID int64
|
ChatID int64
|
||||||
MessageID int
|
MessageID int
|
||||||
}
|
}
|
||||||
|
@ -1149,7 +1150,12 @@ func (config DeleteMessageConfig) method() string {
|
||||||
func (config DeleteMessageConfig) values() (url.Values, error) {
|
func (config DeleteMessageConfig) values() (url.Values, error) {
|
||||||
v := url.Values{}
|
v := url.Values{}
|
||||||
|
|
||||||
|
if config.ChannelUsername == "" {
|
||||||
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
|
v.Add("chat_id", strconv.FormatInt(config.ChatID, 10))
|
||||||
|
} else {
|
||||||
|
v.Add("chat_id", config.ChannelUsername)
|
||||||
|
}
|
||||||
|
|
||||||
v.Add("message_id", strconv.Itoa(config.MessageID))
|
v.Add("message_id", strconv.Itoa(config.MessageID))
|
||||||
|
|
||||||
return v, nil
|
return v, nil
|
||||||
|
|
Loading…
Reference in New Issue