summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/bwmarrin/discordgo/structs.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-09-11 23:23:54 +0200
committerWim <wim@42.be>2017-09-11 23:23:54 +0200
commit49204cafcc770cc20835fab3b793b6e2d85b8f78 (patch)
tree946650ebf15bad09055d866b06ef3a0e5943c6cf /vendor/github.com/bwmarrin/discordgo/structs.go
parent812db2d26775650a506cf988cd6219a5f93e24f5 (diff)
downloadmatterbridge-msglm-49204cafcc770cc20835fab3b793b6e2d85b8f78.tar.gz
matterbridge-msglm-49204cafcc770cc20835fab3b793b6e2d85b8f78.tar.bz2
matterbridge-msglm-49204cafcc770cc20835fab3b793b6e2d85b8f78.zip
Update vendor (bwmarrin/discordgo) apiv6
Diffstat (limited to 'vendor/github.com/bwmarrin/discordgo/structs.go')
-rw-r--r--vendor/github.com/bwmarrin/discordgo/structs.go87
1 files changed, 83 insertions, 4 deletions
diff --git a/vendor/github.com/bwmarrin/discordgo/structs.go b/vendor/github.com/bwmarrin/discordgo/structs.go
index 32f435ce..c3e39566 100644
--- a/vendor/github.com/bwmarrin/discordgo/structs.go
+++ b/vendor/github.com/bwmarrin/discordgo/structs.go
@@ -50,6 +50,10 @@ type Session struct {
// active guilds and the members of the guilds.
StateEnabled bool
+ // Whether or not to call event handlers synchronously.
+ // e.g false = launch event handlers in their own goroutines.
+ SyncEvents bool
+
// Exposed but should not be modified by User.
// Whether the Data Websocket is ready
@@ -78,6 +82,9 @@ type Session struct {
// The http client used for REST requests
Client *http.Client
+ // Stores the last HeartbeatAck that was recieved (in UTC)
+ LastHeartbeatAck time.Time
+
// Event handlers
handlersMu sync.RWMutex
handlers map[string][]*eventHandlerInstance
@@ -141,18 +148,30 @@ type Invite struct {
Temporary bool `json:"temporary"`
}
+// ChannelType is the type of a Channel
+type ChannelType int
+
+// Block contains known ChannelType values
+const (
+ ChannelTypeGuildText ChannelType = iota
+ ChannelTypeDM
+ ChannelTypeGuildVoice
+ ChannelTypeGroupDM
+ ChannelTypeGuildCategory
+)
+
// A Channel holds all data related to an individual Discord channel.
type Channel struct {
ID string `json:"id"`
GuildID string `json:"guild_id"`
Name string `json:"name"`
Topic string `json:"topic"`
- Type string `json:"type"`
+ Type ChannelType `json:"type"`
LastMessageID string `json:"last_message_id"`
+ NSFW bool `json:"nsfw"`
Position int `json:"position"`
Bitrate int `json:"bitrate"`
- IsPrivate bool `json:"is_private"`
- Recipient *User `json:"recipient"`
+ Recipients []*User `json:"recipient"`
Messages []*Message `json:"-"`
PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites"`
}
@@ -292,13 +311,14 @@ type Presence struct {
Game *Game `json:"game"`
Nick string `json:"nick"`
Roles []string `json:"roles"`
+ Since *int `json:"since"`
}
// A Game struct holds the name of the "playing .." game for a user
type Game struct {
Name string `json:"name"`
Type int `json:"type"`
- URL string `json:"url"`
+ URL string `json:"url,omitempty"`
}
// UnmarshalJSON unmarshals json to Game struct
@@ -509,6 +529,12 @@ type MessageReaction struct {
ChannelID string `json:"channel_id"`
}
+// GatewayBotResponse stores the data for the gateway/bot response
+type GatewayBotResponse struct {
+ URL string `json:"url"`
+ Shards int `json:"shards"`
+}
+
// Constants for the different bit offsets of text channel permissions
const (
PermissionReadMessages = 1 << (iota + 10)
@@ -579,3 +605,56 @@ const (
PermissionManageServer |
PermissionAdministrator
)
+
+// Block contains Discord JSON Error Response codes
+const (
+ ErrCodeUnknownAccount = 10001
+ ErrCodeUnknownApplication = 10002
+ ErrCodeUnknownChannel = 10003
+ ErrCodeUnknownGuild = 10004
+ ErrCodeUnknownIntegration = 10005
+ ErrCodeUnknownInvite = 10006
+ ErrCodeUnknownMember = 10007
+ ErrCodeUnknownMessage = 10008
+ ErrCodeUnknownOverwrite = 10009
+ ErrCodeUnknownProvider = 10010
+ ErrCodeUnknownRole = 10011
+ ErrCodeUnknownToken = 10012
+ ErrCodeUnknownUser = 10013
+ ErrCodeUnknownEmoji = 10014
+
+ ErrCodeBotsCannotUseEndpoint = 20001
+ ErrCodeOnlyBotsCanUseEndpoint = 20002
+
+ ErrCodeMaximumGuildsReached = 30001
+ ErrCodeMaximumFriendsReached = 30002
+ ErrCodeMaximumPinsReached = 30003
+ ErrCodeMaximumGuildRolesReached = 30005
+ ErrCodeTooManyReactions = 30010
+
+ ErrCodeUnauthorized = 40001
+
+ ErrCodeMissingAccess = 50001
+ ErrCodeInvalidAccountType = 50002
+ ErrCodeCannotExecuteActionOnDMChannel = 50003
+ ErrCodeEmbedCisabled = 50004
+ ErrCodeCannotEditFromAnotherUser = 50005
+ ErrCodeCannotSendEmptyMessage = 50006
+ ErrCodeCannotSendMessagesToThisUser = 50007
+ ErrCodeCannotSendMessagesInVoiceChannel = 50008
+ ErrCodeChannelVerificationLevelTooHigh = 50009
+ ErrCodeOAuth2ApplicationDoesNotHaveBot = 50010
+ ErrCodeOAuth2ApplicationLimitReached = 50011
+ ErrCodeInvalidOAuthState = 50012
+ ErrCodeMissingPermissions = 50013
+ ErrCodeInvalidAuthenticationToken = 50014
+ ErrCodeNoteTooLong = 50015
+ ErrCodeTooFewOrTooManyMessagesToDelete = 50016
+ ErrCodeCanOnlyPinMessageToOriginatingChannel = 50019
+ ErrCodeCannotExecuteActionOnSystemMessage = 50021
+ ErrCodeMessageProvidedTooOldForBulkDelete = 50034
+ ErrCodeInvalidFormBody = 50035
+ ErrCodeInviteAcceptedToGuildApplicationsBotNotIn = 50036
+
+ ErrCodeReactionBlocked = 90001
+)