1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-28 17:53:30 +00:00

Merge pull request #66 from mavolin/63-edit

This commit is contained in:
diamondburned 2020-05-15 10:45:53 -07:00 committed by GitHub
commit 6f6cf2b85c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -152,7 +152,8 @@ type EditMessageData struct {
// Content is the new message contents (up to 2000 characters).
Content option.NullableString `json:"content,omitempty"`
// Embed contains embedded rich content.
Embed *discord.Embed `json:"embed,omitempty"`
Embed *discord.Embed `json:"embed,omitempty"`
// AllowedMentions are the allowed mentions for a message.
AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"`
// Flags edits the flags of a message (only SUPPRESS_EMBEDS can currently
// be set/unset)
@ -161,7 +162,27 @@ type EditMessageData struct {
Flags *discord.MessageFlags `json:"flags,omitempty"`
}
// EditMessage edits a previously sent message. For more documentation, erfer to
// EditText edits the contents of a previously sent message. For more
// documentation, refer to EditMessageComplex.
func (c *Client) EditText(
channelID, messageID discord.Snowflake, content string) (*discord.Message, error) {
return c.EditMessageComplex(channelID, messageID, EditMessageData{
Content: option.NewNullableString(content),
})
}
// EditEmbed edits the embed of a previously sent message. For more
// documentation, refer to EditMessageComplex.
func (c *Client) EditEmbed(
channelID, messageID discord.Snowflake, embed discord.Embed) (*discord.Message, error) {
return c.EditMessageComplex(channelID, messageID, EditMessageData{
Embed: &embed,
})
}
// EditMessage edits a previously sent message. For more documentation, refer to
// EditMessageComplex.
func (c *Client) EditMessage(
channelID, messageID discord.Snowflake, content string,