structs.go 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. // Discordgo - Discord bindings for Go
  2. // Available at https://github.com/bwmarrin/discordgo
  3. // Copyright 2015-2016 Bruce Marriner <bruce@sqls.net>. All rights reserved.
  4. // Use of this source code is governed by a BSD-style
  5. // license that can be found in the LICENSE file.
  6. // This file contains all structures for the discordgo package. These
  7. // may be moved about later into separate files but I find it easier to have
  8. // them all located together.
  9. package discordgo
  10. import (
  11. "net/http"
  12. "sync"
  13. "time"
  14. "github.com/gorilla/websocket"
  15. )
  16. // A Session represents a connection to the Discord API.
  17. type Session struct {
  18. sync.RWMutex
  19. // General configurable settings.
  20. // Authentication token for this session
  21. Token string
  22. MFA bool
  23. // Debug for printing JSON request/responses
  24. Debug bool // Deprecated, will be removed.
  25. LogLevel int
  26. // Should the session reconnect the websocket on errors.
  27. ShouldReconnectOnError bool
  28. // Should the session request compressed websocket data.
  29. Compress bool
  30. // Sharding
  31. ShardID int
  32. ShardCount int
  33. // Should state tracking be enabled.
  34. // State tracking is the best way for getting the the users
  35. // active guilds and the members of the guilds.
  36. StateEnabled bool
  37. // Whether or not to call event handlers synchronously.
  38. // e.g false = launch event handlers in their own goroutines.
  39. SyncEvents bool
  40. // Exposed but should not be modified by User.
  41. // Whether the Data Websocket is ready
  42. DataReady bool // NOTE: Maye be deprecated soon
  43. // Max number of REST API retries
  44. MaxRestRetries int
  45. // Status stores the currect status of the websocket connection
  46. // this is being tested, may stay, may go away.
  47. status int32
  48. // Whether the Voice Websocket is ready
  49. VoiceReady bool // NOTE: Deprecated.
  50. // Whether the UDP Connection is ready
  51. UDPReady bool // NOTE: Deprecated
  52. // Stores a mapping of guild id's to VoiceConnections
  53. VoiceConnections map[string]*VoiceConnection
  54. // Managed state object, updated internally with events when
  55. // StateEnabled is true.
  56. State *State
  57. // The http client used for REST requests
  58. Client *http.Client
  59. // Stores the last HeartbeatAck that was recieved (in UTC)
  60. LastHeartbeatAck time.Time
  61. // used to deal with rate limits
  62. Ratelimiter *RateLimiter
  63. // Event handlers
  64. handlersMu sync.RWMutex
  65. handlers map[string][]*eventHandlerInstance
  66. onceHandlers map[string][]*eventHandlerInstance
  67. // The websocket connection.
  68. wsConn *websocket.Conn
  69. // When nil, the session is not listening.
  70. listening chan interface{}
  71. // sequence tracks the current gateway api websocket sequence number
  72. sequence *int64
  73. // stores sessions current Discord Gateway
  74. gateway string
  75. // stores session ID of current Gateway connection
  76. sessionID string
  77. // used to make sure gateway websocket writes do not happen concurrently
  78. wsMutex sync.Mutex
  79. }
  80. // A VoiceRegion stores data for a specific voice region server.
  81. type VoiceRegion struct {
  82. ID string `json:"id"`
  83. Name string `json:"name"`
  84. Hostname string `json:"sample_hostname"`
  85. Port int `json:"sample_port"`
  86. }
  87. // A VoiceICE stores data for voice ICE servers.
  88. type VoiceICE struct {
  89. TTL string `json:"ttl"`
  90. Servers []*ICEServer `json:"servers"`
  91. }
  92. // A ICEServer stores data for a specific voice ICE server.
  93. type ICEServer struct {
  94. URL string `json:"url"`
  95. Username string `json:"username"`
  96. Credential string `json:"credential"`
  97. }
  98. // A Invite stores all data related to a specific Discord Guild or Channel invite.
  99. type Invite struct {
  100. Guild *Guild `json:"guild"`
  101. Channel *Channel `json:"channel"`
  102. Inviter *User `json:"inviter"`
  103. Code string `json:"code"`
  104. CreatedAt Timestamp `json:"created_at"`
  105. MaxAge int `json:"max_age"`
  106. Uses int `json:"uses"`
  107. MaxUses int `json:"max_uses"`
  108. XkcdPass string `json:"xkcdpass"`
  109. Revoked bool `json:"revoked"`
  110. Temporary bool `json:"temporary"`
  111. }
  112. // ChannelType is the type of a Channel
  113. type ChannelType int
  114. // Block contains known ChannelType values
  115. const (
  116. ChannelTypeGuildText ChannelType = iota
  117. ChannelTypeDM
  118. ChannelTypeGuildVoice
  119. ChannelTypeGroupDM
  120. ChannelTypeGuildCategory
  121. )
  122. // A Channel holds all data related to an individual Discord channel.
  123. type Channel struct {
  124. ID string `json:"id"`
  125. GuildID string `json:"guild_id"`
  126. Name string `json:"name"`
  127. Topic string `json:"topic"`
  128. Type ChannelType `json:"type"`
  129. LastMessageID string `json:"last_message_id"`
  130. NSFW bool `json:"nsfw"`
  131. Position int `json:"position"`
  132. Bitrate int `json:"bitrate"`
  133. Recipients []*User `json:"recipients"`
  134. Messages []*Message `json:"-"`
  135. PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites"`
  136. ParentID string `json:"parent_id"`
  137. }
  138. // A PermissionOverwrite holds permission overwrite data for a Channel
  139. type PermissionOverwrite struct {
  140. ID string `json:"id"`
  141. Type string `json:"type"`
  142. Deny int `json:"deny"`
  143. Allow int `json:"allow"`
  144. }
  145. // Emoji struct holds data related to Emoji's
  146. type Emoji struct {
  147. ID string `json:"id"`
  148. Name string `json:"name"`
  149. Roles []string `json:"roles"`
  150. Managed bool `json:"managed"`
  151. RequireColons bool `json:"require_colons"`
  152. }
  153. // APIName returns an correctly formatted API name for use in the MessageReactions endpoints.
  154. func (e *Emoji) APIName() string {
  155. if e.ID != "" && e.Name != "" {
  156. return e.Name + ":" + e.ID
  157. }
  158. if e.Name != "" {
  159. return e.Name
  160. }
  161. return e.ID
  162. }
  163. // VerificationLevel type defination
  164. type VerificationLevel int
  165. // Constants for VerificationLevel levels from 0 to 3 inclusive
  166. const (
  167. VerificationLevelNone VerificationLevel = iota
  168. VerificationLevelLow
  169. VerificationLevelMedium
  170. VerificationLevelHigh
  171. )
  172. // A Guild holds all data related to a specific Discord Guild. Guilds are also
  173. // sometimes referred to as Servers in the Discord client.
  174. type Guild struct {
  175. ID string `json:"id"`
  176. Name string `json:"name"`
  177. Icon string `json:"icon"`
  178. Region string `json:"region"`
  179. AfkChannelID string `json:"afk_channel_id"`
  180. EmbedChannelID string `json:"embed_channel_id"`
  181. OwnerID string `json:"owner_id"`
  182. JoinedAt Timestamp `json:"joined_at"`
  183. Splash string `json:"splash"`
  184. AfkTimeout int `json:"afk_timeout"`
  185. MemberCount int `json:"member_count"`
  186. VerificationLevel VerificationLevel `json:"verification_level"`
  187. EmbedEnabled bool `json:"embed_enabled"`
  188. Large bool `json:"large"` // ??
  189. DefaultMessageNotifications int `json:"default_message_notifications"`
  190. Roles []*Role `json:"roles"`
  191. Emojis []*Emoji `json:"emojis"`
  192. Members []*Member `json:"members"`
  193. Presences []*Presence `json:"presences"`
  194. Channels []*Channel `json:"channels"`
  195. VoiceStates []*VoiceState `json:"voice_states"`
  196. Unavailable bool `json:"unavailable"`
  197. }
  198. // A UserGuild holds a brief version of a Guild
  199. type UserGuild struct {
  200. ID string `json:"id"`
  201. Name string `json:"name"`
  202. Icon string `json:"icon"`
  203. Owner bool `json:"owner"`
  204. Permissions int `json:"permissions"`
  205. }
  206. // A GuildParams stores all the data needed to update discord guild settings
  207. type GuildParams struct {
  208. Name string `json:"name,omitempty"`
  209. Region string `json:"region,omitempty"`
  210. VerificationLevel *VerificationLevel `json:"verification_level,omitempty"`
  211. DefaultMessageNotifications int `json:"default_message_notifications,omitempty"` // TODO: Separate type?
  212. AfkChannelID string `json:"afk_channel_id,omitempty"`
  213. AfkTimeout int `json:"afk_timeout,omitempty"`
  214. Icon string `json:"icon,omitempty"`
  215. OwnerID string `json:"owner_id,omitempty"`
  216. Splash string `json:"splash,omitempty"`
  217. }
  218. // A Role stores information about Discord guild member roles.
  219. type Role struct {
  220. ID string `json:"id"`
  221. Name string `json:"name"`
  222. Managed bool `json:"managed"`
  223. Mentionable bool `json:"mentionable"`
  224. Hoist bool `json:"hoist"`
  225. Color int `json:"color"`
  226. Position int `json:"position"`
  227. Permissions int `json:"permissions"`
  228. }
  229. // Roles are a collection of Role
  230. type Roles []*Role
  231. func (r Roles) Len() int {
  232. return len(r)
  233. }
  234. func (r Roles) Less(i, j int) bool {
  235. return r[i].Position > r[j].Position
  236. }
  237. func (r Roles) Swap(i, j int) {
  238. r[i], r[j] = r[j], r[i]
  239. }
  240. // A VoiceState stores the voice states of Guilds
  241. type VoiceState struct {
  242. UserID string `json:"user_id"`
  243. SessionID string `json:"session_id"`
  244. ChannelID string `json:"channel_id"`
  245. GuildID string `json:"guild_id"`
  246. Suppress bool `json:"suppress"`
  247. SelfMute bool `json:"self_mute"`
  248. SelfDeaf bool `json:"self_deaf"`
  249. Mute bool `json:"mute"`
  250. Deaf bool `json:"deaf"`
  251. }
  252. // A Presence stores the online, offline, or idle and game status of Guild members.
  253. type Presence struct {
  254. User *User `json:"user"`
  255. Status Status `json:"status"`
  256. Game *Game `json:"game"`
  257. Nick string `json:"nick"`
  258. Roles []string `json:"roles"`
  259. Since *int `json:"since"`
  260. }
  261. // GameType is the type of "game" (see GameType* consts) in the Game struct
  262. type GameType int
  263. // Valid GameType values
  264. const (
  265. GameTypeGame GameType = iota
  266. GameTypeStreaming
  267. )
  268. // A Game struct holds the name of the "playing .." game for a user
  269. type Game struct {
  270. Name string `json:"name"`
  271. Type GameType `json:"type"`
  272. URL string `json:"url,omitempty"`
  273. Details string `json:"details,omitempty"`
  274. State string `json:"state,omitempty"`
  275. TimeStamps TimeStamps `json:"timestamps,omitempty"`
  276. Assets Assets `json:"assets,omitempty"`
  277. ApplicationID string `json:"application_id,omitempty"`
  278. Instance int8 `json:"instance,omitempty"`
  279. // TODO: Party and Secrets (unknown structure)
  280. }
  281. // A TimeStamps struct contains start and end times used in the rich presence "playing .." Game
  282. type TimeStamps struct {
  283. EndTimestamp uint `json:"end,omitempty"`
  284. StartTimestamp uint `json:"start,omitempty"`
  285. }
  286. // An Assets struct contains assets and labels used in the rich presence "playing .." Game
  287. type Assets struct {
  288. LargeImageID string `json:"large_image,omitempty"`
  289. SmallImageID string `json:"small_image,omitempty"`
  290. LargeText string `json:"large_text,omitempty"`
  291. SmallText string `json:"small_text,omitempty"`
  292. }
  293. // A Member stores user information for Guild members.
  294. type Member struct {
  295. GuildID string `json:"guild_id"`
  296. JoinedAt string `json:"joined_at"`
  297. Nick string `json:"nick"`
  298. Deaf bool `json:"deaf"`
  299. Mute bool `json:"mute"`
  300. User *User `json:"user"`
  301. Roles []string `json:"roles"`
  302. }
  303. // A Settings stores data for a specific users Discord client settings.
  304. type Settings struct {
  305. RenderEmbeds bool `json:"render_embeds"`
  306. InlineEmbedMedia bool `json:"inline_embed_media"`
  307. InlineAttachmentMedia bool `json:"inline_attachment_media"`
  308. EnableTtsCommand bool `json:"enable_tts_command"`
  309. MessageDisplayCompact bool `json:"message_display_compact"`
  310. ShowCurrentGame bool `json:"show_current_game"`
  311. ConvertEmoticons bool `json:"convert_emoticons"`
  312. Locale string `json:"locale"`
  313. Theme string `json:"theme"`
  314. GuildPositions []string `json:"guild_positions"`
  315. RestrictedGuilds []string `json:"restricted_guilds"`
  316. FriendSourceFlags *FriendSourceFlags `json:"friend_source_flags"`
  317. Status Status `json:"status"`
  318. DetectPlatformAccounts bool `json:"detect_platform_accounts"`
  319. DeveloperMode bool `json:"developer_mode"`
  320. }
  321. // Status type defination
  322. type Status string
  323. // Constants for Status with the different current available status
  324. const (
  325. StatusOnline Status = "online"
  326. StatusIdle Status = "idle"
  327. StatusDoNotDisturb Status = "dnd"
  328. StatusInvisible Status = "invisible"
  329. StatusOffline Status = "offline"
  330. )
  331. // FriendSourceFlags stores ... TODO :)
  332. type FriendSourceFlags struct {
  333. All bool `json:"all"`
  334. MutualGuilds bool `json:"mutual_guilds"`
  335. MutualFriends bool `json:"mutual_friends"`
  336. }
  337. // A Relationship between the logged in user and Relationship.User
  338. type Relationship struct {
  339. User *User `json:"user"`
  340. Type int `json:"type"` // 1 = friend, 2 = blocked, 3 = incoming friend req, 4 = sent friend req
  341. ID string `json:"id"`
  342. }
  343. // A TooManyRequests struct holds information received from Discord
  344. // when receiving a HTTP 429 response.
  345. type TooManyRequests struct {
  346. Bucket string `json:"bucket"`
  347. Message string `json:"message"`
  348. RetryAfter time.Duration `json:"retry_after"`
  349. }
  350. // A ReadState stores data on the read state of channels.
  351. type ReadState struct {
  352. MentionCount int `json:"mention_count"`
  353. LastMessageID string `json:"last_message_id"`
  354. ID string `json:"id"`
  355. }
  356. // An Ack is used to ack messages
  357. type Ack struct {
  358. Token string `json:"token"`
  359. }
  360. // A GuildRole stores data for guild roles.
  361. type GuildRole struct {
  362. Role *Role `json:"role"`
  363. GuildID string `json:"guild_id"`
  364. }
  365. // A GuildBan stores data for a guild ban.
  366. type GuildBan struct {
  367. Reason string `json:"reason"`
  368. User *User `json:"user"`
  369. }
  370. // A GuildIntegration stores data for a guild integration.
  371. type GuildIntegration struct {
  372. ID string `json:"id"`
  373. Name string `json:"name"`
  374. Type string `json:"type"`
  375. Enabled bool `json:"enabled"`
  376. Syncing bool `json:"syncing"`
  377. RoleID string `json:"role_id"`
  378. ExpireBehavior int `json:"expire_behavior"`
  379. ExpireGracePeriod int `json:"expire_grace_period"`
  380. User *User `json:"user"`
  381. Account *GuildIntegrationAccount `json:"account"`
  382. SyncedAt int `json:"synced_at"`
  383. }
  384. // A GuildIntegrationAccount stores data for a guild integration account.
  385. type GuildIntegrationAccount struct {
  386. ID string `json:"id"`
  387. Name string `json:"name"`
  388. }
  389. // A GuildEmbed stores data for a guild embed.
  390. type GuildEmbed struct {
  391. Enabled bool `json:"enabled"`
  392. ChannelID string `json:"channel_id"`
  393. }
  394. // A UserGuildSettingsChannelOverride stores data for a channel override for a users guild settings.
  395. type UserGuildSettingsChannelOverride struct {
  396. Muted bool `json:"muted"`
  397. MessageNotifications int `json:"message_notifications"`
  398. ChannelID string `json:"channel_id"`
  399. }
  400. // A UserGuildSettings stores data for a users guild settings.
  401. type UserGuildSettings struct {
  402. SupressEveryone bool `json:"suppress_everyone"`
  403. Muted bool `json:"muted"`
  404. MobilePush bool `json:"mobile_push"`
  405. MessageNotifications int `json:"message_notifications"`
  406. GuildID string `json:"guild_id"`
  407. ChannelOverrides []*UserGuildSettingsChannelOverride `json:"channel_overrides"`
  408. }
  409. // A UserGuildSettingsEdit stores data for editing UserGuildSettings
  410. type UserGuildSettingsEdit struct {
  411. SupressEveryone bool `json:"suppress_everyone"`
  412. Muted bool `json:"muted"`
  413. MobilePush bool `json:"mobile_push"`
  414. MessageNotifications int `json:"message_notifications"`
  415. ChannelOverrides map[string]*UserGuildSettingsChannelOverride `json:"channel_overrides"`
  416. }
  417. // An APIErrorMessage is an api error message returned from discord
  418. type APIErrorMessage struct {
  419. Code int `json:"code"`
  420. Message string `json:"message"`
  421. }
  422. // Webhook stores the data for a webhook.
  423. type Webhook struct {
  424. ID string `json:"id"`
  425. GuildID string `json:"guild_id"`
  426. ChannelID string `json:"channel_id"`
  427. User *User `json:"user"`
  428. Name string `json:"name"`
  429. Avatar string `json:"avatar"`
  430. Token string `json:"token"`
  431. }
  432. // WebhookParams is a struct for webhook params, used in the WebhookExecute command.
  433. type WebhookParams struct {
  434. Content string `json:"content,omitempty"`
  435. Username string `json:"username,omitempty"`
  436. AvatarURL string `json:"avatar_url,omitempty"`
  437. TTS bool `json:"tts,omitempty"`
  438. File string `json:"file,omitempty"`
  439. Embeds []*MessageEmbed `json:"embeds,omitempty"`
  440. }
  441. // MessageReaction stores the data for a message reaction.
  442. type MessageReaction struct {
  443. UserID string `json:"user_id"`
  444. MessageID string `json:"message_id"`
  445. Emoji Emoji `json:"emoji"`
  446. ChannelID string `json:"channel_id"`
  447. }
  448. // GatewayBotResponse stores the data for the gateway/bot response
  449. type GatewayBotResponse struct {
  450. URL string `json:"url"`
  451. Shards int `json:"shards"`
  452. }
  453. // Constants for the different bit offsets of text channel permissions
  454. const (
  455. PermissionReadMessages = 1 << (iota + 10)
  456. PermissionSendMessages
  457. PermissionSendTTSMessages
  458. PermissionManageMessages
  459. PermissionEmbedLinks
  460. PermissionAttachFiles
  461. PermissionReadMessageHistory
  462. PermissionMentionEveryone
  463. PermissionUseExternalEmojis
  464. )
  465. // Constants for the different bit offsets of voice permissions
  466. const (
  467. PermissionVoiceConnect = 1 << (iota + 20)
  468. PermissionVoiceSpeak
  469. PermissionVoiceMuteMembers
  470. PermissionVoiceDeafenMembers
  471. PermissionVoiceMoveMembers
  472. PermissionVoiceUseVAD
  473. )
  474. // Constants for general management.
  475. const (
  476. PermissionChangeNickname = 1 << (iota + 26)
  477. PermissionManageNicknames
  478. PermissionManageRoles
  479. PermissionManageWebhooks
  480. PermissionManageEmojis
  481. )
  482. // Constants for the different bit offsets of general permissions
  483. const (
  484. PermissionCreateInstantInvite = 1 << iota
  485. PermissionKickMembers
  486. PermissionBanMembers
  487. PermissionAdministrator
  488. PermissionManageChannels
  489. PermissionManageServer
  490. PermissionAddReactions
  491. PermissionViewAuditLogs
  492. PermissionAllText = PermissionReadMessages |
  493. PermissionSendMessages |
  494. PermissionSendTTSMessages |
  495. PermissionManageMessages |
  496. PermissionEmbedLinks |
  497. PermissionAttachFiles |
  498. PermissionReadMessageHistory |
  499. PermissionMentionEveryone
  500. PermissionAllVoice = PermissionVoiceConnect |
  501. PermissionVoiceSpeak |
  502. PermissionVoiceMuteMembers |
  503. PermissionVoiceDeafenMembers |
  504. PermissionVoiceMoveMembers |
  505. PermissionVoiceUseVAD
  506. PermissionAllChannel = PermissionAllText |
  507. PermissionAllVoice |
  508. PermissionCreateInstantInvite |
  509. PermissionManageRoles |
  510. PermissionManageChannels |
  511. PermissionAddReactions |
  512. PermissionViewAuditLogs
  513. PermissionAll = PermissionAllChannel |
  514. PermissionKickMembers |
  515. PermissionBanMembers |
  516. PermissionManageServer |
  517. PermissionAdministrator
  518. )
  519. // Block contains Discord JSON Error Response codes
  520. const (
  521. ErrCodeUnknownAccount = 10001
  522. ErrCodeUnknownApplication = 10002
  523. ErrCodeUnknownChannel = 10003
  524. ErrCodeUnknownGuild = 10004
  525. ErrCodeUnknownIntegration = 10005
  526. ErrCodeUnknownInvite = 10006
  527. ErrCodeUnknownMember = 10007
  528. ErrCodeUnknownMessage = 10008
  529. ErrCodeUnknownOverwrite = 10009
  530. ErrCodeUnknownProvider = 10010
  531. ErrCodeUnknownRole = 10011
  532. ErrCodeUnknownToken = 10012
  533. ErrCodeUnknownUser = 10013
  534. ErrCodeUnknownEmoji = 10014
  535. ErrCodeBotsCannotUseEndpoint = 20001
  536. ErrCodeOnlyBotsCanUseEndpoint = 20002
  537. ErrCodeMaximumGuildsReached = 30001
  538. ErrCodeMaximumFriendsReached = 30002
  539. ErrCodeMaximumPinsReached = 30003
  540. ErrCodeMaximumGuildRolesReached = 30005
  541. ErrCodeTooManyReactions = 30010
  542. ErrCodeUnauthorized = 40001
  543. ErrCodeMissingAccess = 50001
  544. ErrCodeInvalidAccountType = 50002
  545. ErrCodeCannotExecuteActionOnDMChannel = 50003
  546. ErrCodeEmbedCisabled = 50004
  547. ErrCodeCannotEditFromAnotherUser = 50005
  548. ErrCodeCannotSendEmptyMessage = 50006
  549. ErrCodeCannotSendMessagesToThisUser = 50007
  550. ErrCodeCannotSendMessagesInVoiceChannel = 50008
  551. ErrCodeChannelVerificationLevelTooHigh = 50009
  552. ErrCodeOAuth2ApplicationDoesNotHaveBot = 50010
  553. ErrCodeOAuth2ApplicationLimitReached = 50011
  554. ErrCodeInvalidOAuthState = 50012
  555. ErrCodeMissingPermissions = 50013
  556. ErrCodeInvalidAuthenticationToken = 50014
  557. ErrCodeNoteTooLong = 50015
  558. ErrCodeTooFewOrTooManyMessagesToDelete = 50016
  559. ErrCodeCanOnlyPinMessageToOriginatingChannel = 50019
  560. ErrCodeCannotExecuteActionOnSystemMessage = 50021
  561. ErrCodeMessageProvidedTooOldForBulkDelete = 50034
  562. ErrCodeInvalidFormBody = 50035
  563. ErrCodeInviteAcceptedToGuildApplicationsBotNotIn = 50036
  564. ErrCodeReactionBlocked = 90001
  565. )