|
@@ -150,6 +150,7 @@ type MessageSend struct {
|
|
|
TTS bool `json:"tts"`
|
|
|
Files []*File `json:"-"`
|
|
|
AllowedMentions *MessageAllowedMentions `json:"allowed_mentions,omitempty"`
|
|
|
+ Reference *MessageReference `json:"message_reference,omitempty"`
|
|
|
|
|
|
// TODO: Remove this when compatibility is not required.
|
|
|
File *File `json:"-"`
|
|
@@ -371,6 +372,15 @@ type MessageReference struct {
|
|
|
GuildID string `json:"guild_id"`
|
|
|
}
|
|
|
|
|
|
+// Reference returns MessageReference of given message
|
|
|
+func (m *Message) Reference() *MessageReference {
|
|
|
+ return &MessageReference{
|
|
|
+ GuildID: m.GuildID,
|
|
|
+ ChannelID: m.ChannelID,
|
|
|
+ MessageID: m.ID,
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// ContentWithMentionsReplaced will replace all @<id> mentions with the
|
|
|
// username of the mention.
|
|
|
func (m *Message) ContentWithMentionsReplaced() (content string) {
|