added edit message function.

This commit is contained in:
5elenay 2021-08-21 13:56:22 +03:00
parent a438e72086
commit 033ca53ec5

View File

@ -71,3 +71,14 @@ type MessageEmbeddedVideo struct {
Width int `json:"width"` Width int `json:"width"`
Height int `json:"height"` Height int `json:"height"`
} }
// Edit message content.
func (m *Message) Edit(content string) error {
_, err := m.Client.Request("PATCH", "/channels/"+m.ChannelId+"/messages/"+m.Id, []byte("{\"content\": \""+content+"\"}"))
if err != nil {
return err
}
return nil
}