diff options
author | Wim <wim@42.be> | 2020-09-04 23:29:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-04 23:29:13 +0200 |
commit | 2f59abdda7a1072036ea1fdb4c859cccbb56efa6 (patch) | |
tree | e35393f23d12783ae92f0469085efc7dec953f82 /vendor/github.com/matterbridge/discordgo/message.go | |
parent | 17747a5c8893fd47ba8eb61dd10477170640caf6 (diff) | |
download | matterbridge-msglm-2f59abdda7a1072036ea1fdb4c859cccbb56efa6.tar.gz matterbridge-msglm-2f59abdda7a1072036ea1fdb4c859cccbb56efa6.tar.bz2 matterbridge-msglm-2f59abdda7a1072036ea1fdb4c859cccbb56efa6.zip |
Update vendor (#1228)
Diffstat (limited to 'vendor/github.com/matterbridge/discordgo/message.go')
-rw-r--r-- | vendor/github.com/matterbridge/discordgo/message.go | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/vendor/github.com/matterbridge/discordgo/message.go b/vendor/github.com/matterbridge/discordgo/message.go index 00b8112b..f4b20fee 100644 --- a/vendor/github.com/matterbridge/discordgo/message.go +++ b/vendor/github.com/matterbridge/discordgo/message.go @@ -16,6 +16,7 @@ import ( ) // MessageType is the type of Message +// https://discord.com/developers/docs/resources/channel#message-object-message-types type MessageType int // Block contains the valid known MessageType values @@ -33,6 +34,8 @@ const ( MessageTypeUserPremiumGuildSubscriptionTierTwo MessageTypeUserPremiumGuildSubscriptionTierThree MessageTypeChannelFollowAdd + MessageTypeGuildDiscoveryDisqualified + MessageTypeGuildDiscoveryRequalified ) // A Message stores all data related to a specific Discord message. @@ -117,9 +120,22 @@ type Message struct { // The flags of the message, which describe extra features of a message. // This is a combination of bit masks; the presence of a certain permission can // be checked by performing a bitwise AND between this int and the flag. - Flags int `json:"flags"` + Flags MessageFlags `json:"flags"` } +// MessageFlags is the flags of "message" (see MessageFlags* consts) +// https://discord.com/developers/docs/resources/channel#message-object-message-flags +type MessageFlags int + +// Valid MessageFlags values +const ( + MessageFlagsCrossPosted MessageFlags = 1 << iota + MessageFlagsIsCrossPosted + MessageFlagsSupressEmbeds + MessageFlagsSourceMessageDeleted + MessageFlagsUrgent +) + // File stores info about files you e.g. send in messages. type File struct { Name string @@ -245,10 +261,9 @@ type MessageEmbedThumbnail struct { // MessageEmbedVideo is a part of a MessageEmbed struct. type MessageEmbedVideo struct { - URL string `json:"url,omitempty"` - ProxyURL string `json:"proxy_url,omitempty"` - Width int `json:"width,omitempty"` - Height int `json:"height,omitempty"` + URL string `json:"url,omitempty"` + Width int `json:"width,omitempty"` + Height int `json:"height,omitempty"` } // MessageEmbedProvider is a part of a MessageEmbed struct. @@ -275,7 +290,7 @@ type MessageEmbedField struct { // An MessageEmbed stores data for message embeds. type MessageEmbed struct { URL string `json:"url,omitempty"` - Type string `json:"type,omitempty"` + Type EmbedType `json:"type,omitempty"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Timestamp string `json:"timestamp,omitempty"` @@ -289,6 +304,20 @@ type MessageEmbed struct { Fields []*MessageEmbedField `json:"fields,omitempty"` } +// EmbedType is the type of embed +// https://discord.com/developers/docs/resources/channel#embed-object-embed-types +type EmbedType string + +// Block of valid EmbedTypes +const ( + EmbedTypeRich EmbedType = "rich" + EmbedTypeImage EmbedType = "image" + EmbedTypeVideo EmbedType = "video" + EmbedTypeGifv EmbedType = "gifv" + EmbedTypeArticle EmbedType = "article" + EmbedTypeLink EmbedType = "link" +) + // MessageReactions holds a reactions object for a message. type MessageReactions struct { Count int `json:"count"` @@ -307,7 +336,7 @@ type MessageActivityType int // Constants for the different types of Message Activity const ( - MessageActivityTypeJoin = iota + 1 + MessageActivityTypeJoin MessageActivityType = iota + 1 MessageActivityTypeSpectate MessageActivityTypeListen MessageActivityTypeJoinRequest @@ -319,7 +348,7 @@ type MessageFlag int // Constants for the different bit offsets of Message Flags const ( // This message has been published to subscribed channels (via Channel Following) - MessageFlagCrossposted = 1 << iota + MessageFlagCrossposted MessageFlag = 1 << iota // This message originated from a message in another channel (via Channel Following) MessageFlagIsCrosspost // Do not include any embeds when serializing this message |