Expose flags on MessageEdit so you can suppress embeds on other messages (#973)
* Expose Flags on MessageEdit and add SuppressEmbeds Also fix typo in the message flags enum * Fix deprecation comment * Add omitempty to Flags member I wasn't sure if this was going to work but the documentation says: > The "omitempty" option specifies that the field should be omitted from the encoding if the field has an empty value, defined as false, 0, a nil pointer, a nil interface value, and any empty array, slice, map, or string. Therefore, if Flags is unmodified it will be omitted. * Make Components omitempty I think the null value here may be triggering the "Cannot edit a message authored by another user" * Remove convenience function for now * Move deprecated member out of list Stops the gofmt error * Fix golint issue * Change deprecation comment * feat: code review changes Co-authored-by: nitroflap <fe.lap.prog@gmail.com>
This commit is contained in:
parent
c615fc7f19
commit
b138df6efe
1 changed files with 4 additions and 1 deletions
|
@ -199,7 +199,9 @@ const (
|
|||
MessageFlagsCrossPosted MessageFlags = 1 << 0
|
||||
// MessageFlagsIsCrossPosted this message originated from a message in another channel (via Channel Following).
|
||||
MessageFlagsIsCrossPosted MessageFlags = 1 << 1
|
||||
// MessageFlagsSupressEmbeds do not include any embeds when serializing this message.
|
||||
// MessageFlagsSuppressEmbeds do not include any embeds when serializing this message.
|
||||
MessageFlagsSuppressEmbeds MessageFlags = 1 << 2
|
||||
// TODO: deprecated, remove when compatibility is not needed
|
||||
MessageFlagsSupressEmbeds MessageFlags = 1 << 2
|
||||
// MessageFlagsSourceMessageDeleted the source message for this crosspost has been deleted (via Channel Following).
|
||||
MessageFlagsSourceMessageDeleted MessageFlags = 1 << 3
|
||||
|
@ -246,6 +248,7 @@ type MessageEdit struct {
|
|||
Components []MessageComponent `json:"components"`
|
||||
Embeds []*MessageEmbed `json:"embeds"`
|
||||
AllowedMentions *MessageAllowedMentions `json:"allowed_mentions,omitempty"`
|
||||
Flags MessageFlags `json:"flags,omitempty"`
|
||||
|
||||
ID string
|
||||
Channel string
|
||||
|
|
Loading…
Reference in a new issue