mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-11-29 02:03:35 +00:00
Merge pull request #66 from mavolin/63-edit
This commit is contained in:
commit
6f6cf2b85c
|
@ -152,7 +152,8 @@ type EditMessageData struct {
|
||||||
// Content is the new message contents (up to 2000 characters).
|
// Content is the new message contents (up to 2000 characters).
|
||||||
Content option.NullableString `json:"content,omitempty"`
|
Content option.NullableString `json:"content,omitempty"`
|
||||||
// Embed contains embedded rich content.
|
// 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"`
|
AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"`
|
||||||
// Flags edits the flags of a message (only SUPPRESS_EMBEDS can currently
|
// Flags edits the flags of a message (only SUPPRESS_EMBEDS can currently
|
||||||
// be set/unset)
|
// be set/unset)
|
||||||
|
@ -161,7 +162,27 @@ type EditMessageData struct {
|
||||||
Flags *discord.MessageFlags `json:"flags,omitempty"`
|
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.
|
// EditMessageComplex.
|
||||||
func (c *Client) EditMessage(
|
func (c *Client) EditMessage(
|
||||||
channelID, messageID discord.Snowflake, content string,
|
channelID, messageID discord.Snowflake, content string,
|
||||||
|
|
Loading…
Reference in a new issue