structs.go 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  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. // A game type
  262. type GameType int
  263. const (
  264. GameTypeGame GameType = iota
  265. GameTypeStreaming
  266. )
  267. // A Game struct holds the name of the "playing .." game for a user
  268. type Game struct {
  269. Name string `json:"name"`
  270. Type GameType `json:"type"`
  271. URL string `json:"url,omitempty"`
  272. Details string `json:"details,omitempty"`
  273. State string `json:"state,omitempty"`
  274. TimeStamps TimeStamps `json:"timestamps,omitempty"`
  275. Assets Assets `json:"assets,omitempty"`
  276. ApplicationID string `json:"application_id,omitempty"`
  277. Instance int8 `json:"instance,omitempty"`
  278. // TODO: Party and Secrets (unknown structure)
  279. }
  280. // A TimeStamps struct contains start and end times used in the rich presence "playing .." Game
  281. type TimeStamps struct {
  282. EndTimestamp uint `json:"end,omitempty"`
  283. StartTimestamp uint `json:"start,omitempty"`
  284. }
  285. // An Assets struct contains assets and labels used in the rich presence "playing .." Game
  286. type Assets struct {
  287. LargeImageID string `json:"large_image,omitempty"`
  288. SmallImageID string `json:"small_image,omitempty"`
  289. LargeText string `json:"large_text,omitempty"`
  290. SmallText string `json:"small_text,omitempty"`
  291. }
  292. // A Member stores user information for Guild members.
  293. type Member struct {
  294. GuildID string `json:"guild_id"`
  295. JoinedAt string `json:"joined_at"`
  296. Nick string `json:"nick"`
  297. Deaf bool `json:"deaf"`
  298. Mute bool `json:"mute"`
  299. User *User `json:"user"`
  300. Roles []string `json:"roles"`
  301. }
  302. // A Settings stores data for a specific users Discord client settings.
  303. type Settings struct {
  304. RenderEmbeds bool `json:"render_embeds"`
  305. InlineEmbedMedia bool `json:"inline_embed_media"`
  306. InlineAttachmentMedia bool `json:"inline_attachment_media"`
  307. EnableTtsCommand bool `json:"enable_tts_command"`
  308. MessageDisplayCompact bool `json:"message_display_compact"`
  309. ShowCurrentGame bool `json:"show_current_game"`
  310. ConvertEmoticons bool `json:"convert_emoticons"`
  311. Locale string `json:"locale"`
  312. Theme string `json:"theme"`
  313. GuildPositions []string `json:"guild_positions"`
  314. RestrictedGuilds []string `json:"restricted_guilds"`
  315. FriendSourceFlags *FriendSourceFlags `json:"friend_source_flags"`
  316. Status Status `json:"status"`
  317. DetectPlatformAccounts bool `json:"detect_platform_accounts"`
  318. DeveloperMode bool `json:"developer_mode"`
  319. }
  320. // Status type defination
  321. type Status string
  322. // Constants for Status with the different current available status
  323. const (
  324. StatusOnline Status = "online"
  325. StatusIdle Status = "idle"
  326. StatusDoNotDisturb Status = "dnd"
  327. StatusInvisible Status = "invisible"
  328. StatusOffline Status = "offline"
  329. )
  330. // FriendSourceFlags stores ... TODO :)
  331. type FriendSourceFlags struct {
  332. All bool `json:"all"`
  333. MutualGuilds bool `json:"mutual_guilds"`
  334. MutualFriends bool `json:"mutual_friends"`
  335. }
  336. // A Relationship between the logged in user and Relationship.User
  337. type Relationship struct {
  338. User *User `json:"user"`
  339. Type int `json:"type"` // 1 = friend, 2 = blocked, 3 = incoming friend req, 4 = sent friend req
  340. ID string `json:"id"`
  341. }
  342. // A TooManyRequests struct holds information received from Discord
  343. // when receiving a HTTP 429 response.
  344. type TooManyRequests struct {
  345. Bucket string `json:"bucket"`
  346. Message string `json:"message"`
  347. RetryAfter time.Duration `json:"retry_after"`
  348. }
  349. // A ReadState stores data on the read state of channels.
  350. type ReadState struct {
  351. MentionCount int `json:"mention_count"`
  352. LastMessageID string `json:"last_message_id"`
  353. ID string `json:"id"`
  354. }
  355. // An Ack is used to ack messages
  356. type Ack struct {
  357. Token string `json:"token"`
  358. }
  359. // A GuildRole stores data for guild roles.
  360. type GuildRole struct {
  361. Role *Role `json:"role"`
  362. GuildID string `json:"guild_id"`
  363. }
  364. // A GuildBan stores data for a guild ban.
  365. type GuildBan struct {
  366. Reason string `json:"reason"`
  367. User *User `json:"user"`
  368. }
  369. // A GuildIntegration stores data for a guild integration.
  370. type GuildIntegration struct {
  371. ID string `json:"id"`
  372. Name string `json:"name"`
  373. Type string `json:"type"`
  374. Enabled bool `json:"enabled"`
  375. Syncing bool `json:"syncing"`
  376. RoleID string `json:"role_id"`
  377. ExpireBehavior int `json:"expire_behavior"`
  378. ExpireGracePeriod int `json:"expire_grace_period"`
  379. User *User `json:"user"`
  380. Account *GuildIntegrationAccount `json:"account"`
  381. SyncedAt int `json:"synced_at"`
  382. }
  383. // A GuildIntegrationAccount stores data for a guild integration account.
  384. type GuildIntegrationAccount struct {
  385. ID string `json:"id"`
  386. Name string `json:"name"`
  387. }
  388. // A GuildEmbed stores data for a guild embed.
  389. type GuildEmbed struct {
  390. Enabled bool `json:"enabled"`
  391. ChannelID string `json:"channel_id"`
  392. }
  393. // A UserGuildSettingsChannelOverride stores data for a channel override for a users guild settings.
  394. type UserGuildSettingsChannelOverride struct {
  395. Muted bool `json:"muted"`
  396. MessageNotifications int `json:"message_notifications"`
  397. ChannelID string `json:"channel_id"`
  398. }
  399. // A UserGuildSettings stores data for a users guild settings.
  400. type UserGuildSettings struct {
  401. SupressEveryone bool `json:"suppress_everyone"`
  402. Muted bool `json:"muted"`
  403. MobilePush bool `json:"mobile_push"`
  404. MessageNotifications int `json:"message_notifications"`
  405. GuildID string `json:"guild_id"`
  406. ChannelOverrides []*UserGuildSettingsChannelOverride `json:"channel_overrides"`
  407. }
  408. // A UserGuildSettingsEdit stores data for editing UserGuildSettings
  409. type UserGuildSettingsEdit struct {
  410. SupressEveryone bool `json:"suppress_everyone"`
  411. Muted bool `json:"muted"`
  412. MobilePush bool `json:"mobile_push"`
  413. MessageNotifications int `json:"message_notifications"`
  414. ChannelOverrides map[string]*UserGuildSettingsChannelOverride `json:"channel_overrides"`
  415. }
  416. // An APIErrorMessage is an api error message returned from discord
  417. type APIErrorMessage struct {
  418. Code int `json:"code"`
  419. Message string `json:"message"`
  420. }
  421. // Webhook stores the data for a webhook.
  422. type Webhook struct {
  423. ID string `json:"id"`
  424. GuildID string `json:"guild_id"`
  425. ChannelID string `json:"channel_id"`
  426. User *User `json:"user"`
  427. Name string `json:"name"`
  428. Avatar string `json:"avatar"`
  429. Token string `json:"token"`
  430. }
  431. // WebhookParams is a struct for webhook params, used in the WebhookExecute command.
  432. type WebhookParams struct {
  433. Content string `json:"content,omitempty"`
  434. Username string `json:"username,omitempty"`
  435. AvatarURL string `json:"avatar_url,omitempty"`
  436. TTS bool `json:"tts,omitempty"`
  437. File string `json:"file,omitempty"`
  438. Embeds []*MessageEmbed `json:"embeds,omitempty"`
  439. }
  440. // MessageReaction stores the data for a message reaction.
  441. type MessageReaction struct {
  442. UserID string `json:"user_id"`
  443. MessageID string `json:"message_id"`
  444. Emoji Emoji `json:"emoji"`
  445. ChannelID string `json:"channel_id"`
  446. }
  447. // GatewayBotResponse stores the data for the gateway/bot response
  448. type GatewayBotResponse struct {
  449. URL string `json:"url"`
  450. Shards int `json:"shards"`
  451. }
  452. // Constants for the different bit offsets of text channel permissions
  453. const (
  454. PermissionReadMessages = 1 << (iota + 10)
  455. PermissionSendMessages
  456. PermissionSendTTSMessages
  457. PermissionManageMessages
  458. PermissionEmbedLinks
  459. PermissionAttachFiles
  460. PermissionReadMessageHistory
  461. PermissionMentionEveryone
  462. PermissionUseExternalEmojis
  463. )
  464. // Constants for the different bit offsets of voice permissions
  465. const (
  466. PermissionVoiceConnect = 1 << (iota + 20)
  467. PermissionVoiceSpeak
  468. PermissionVoiceMuteMembers
  469. PermissionVoiceDeafenMembers
  470. PermissionVoiceMoveMembers
  471. PermissionVoiceUseVAD
  472. )
  473. // Constants for general management.
  474. const (
  475. PermissionChangeNickname = 1 << (iota + 26)
  476. PermissionManageNicknames
  477. PermissionManageRoles
  478. PermissionManageWebhooks
  479. PermissionManageEmojis
  480. )
  481. // Constants for the different bit offsets of general permissions
  482. const (
  483. PermissionCreateInstantInvite = 1 << iota
  484. PermissionKickMembers
  485. PermissionBanMembers
  486. PermissionAdministrator
  487. PermissionManageChannels
  488. PermissionManageServer
  489. PermissionAddReactions
  490. PermissionViewAuditLogs
  491. PermissionAllText = PermissionReadMessages |
  492. PermissionSendMessages |
  493. PermissionSendTTSMessages |
  494. PermissionManageMessages |
  495. PermissionEmbedLinks |
  496. PermissionAttachFiles |
  497. PermissionReadMessageHistory |
  498. PermissionMentionEveryone
  499. PermissionAllVoice = PermissionVoiceConnect |
  500. PermissionVoiceSpeak |
  501. PermissionVoiceMuteMembers |
  502. PermissionVoiceDeafenMembers |
  503. PermissionVoiceMoveMembers |
  504. PermissionVoiceUseVAD
  505. PermissionAllChannel = PermissionAllText |
  506. PermissionAllVoice |
  507. PermissionCreateInstantInvite |
  508. PermissionManageRoles |
  509. PermissionManageChannels |
  510. PermissionAddReactions |
  511. PermissionViewAuditLogs
  512. PermissionAll = PermissionAllChannel |
  513. PermissionKickMembers |
  514. PermissionBanMembers |
  515. PermissionManageServer |
  516. PermissionAdministrator
  517. )
  518. // Block contains Discord JSON Error Response codes
  519. const (
  520. ErrCodeUnknownAccount = 10001
  521. ErrCodeUnknownApplication = 10002
  522. ErrCodeUnknownChannel = 10003
  523. ErrCodeUnknownGuild = 10004
  524. ErrCodeUnknownIntegration = 10005
  525. ErrCodeUnknownInvite = 10006
  526. ErrCodeUnknownMember = 10007
  527. ErrCodeUnknownMessage = 10008
  528. ErrCodeUnknownOverwrite = 10009
  529. ErrCodeUnknownProvider = 10010
  530. ErrCodeUnknownRole = 10011
  531. ErrCodeUnknownToken = 10012
  532. ErrCodeUnknownUser = 10013
  533. ErrCodeUnknownEmoji = 10014
  534. ErrCodeBotsCannotUseEndpoint = 20001
  535. ErrCodeOnlyBotsCanUseEndpoint = 20002
  536. ErrCodeMaximumGuildsReached = 30001
  537. ErrCodeMaximumFriendsReached = 30002
  538. ErrCodeMaximumPinsReached = 30003
  539. ErrCodeMaximumGuildRolesReached = 30005
  540. ErrCodeTooManyReactions = 30010
  541. ErrCodeUnauthorized = 40001
  542. ErrCodeMissingAccess = 50001
  543. ErrCodeInvalidAccountType = 50002
  544. ErrCodeCannotExecuteActionOnDMChannel = 50003
  545. ErrCodeEmbedCisabled = 50004
  546. ErrCodeCannotEditFromAnotherUser = 50005
  547. ErrCodeCannotSendEmptyMessage = 50006
  548. ErrCodeCannotSendMessagesToThisUser = 50007
  549. ErrCodeCannotSendMessagesInVoiceChannel = 50008
  550. ErrCodeChannelVerificationLevelTooHigh = 50009
  551. ErrCodeOAuth2ApplicationDoesNotHaveBot = 50010
  552. ErrCodeOAuth2ApplicationLimitReached = 50011
  553. ErrCodeInvalidOAuthState = 50012
  554. ErrCodeMissingPermissions = 50013
  555. ErrCodeInvalidAuthenticationToken = 50014
  556. ErrCodeNoteTooLong = 50015
  557. ErrCodeTooFewOrTooManyMessagesToDelete = 50016
  558. ErrCodeCanOnlyPinMessageToOriginatingChannel = 50019
  559. ErrCodeCannotExecuteActionOnSystemMessage = 50021
  560. ErrCodeMessageProvidedTooOldForBulkDelete = 50034
  561. ErrCodeInvalidFormBody = 50035
  562. ErrCodeInviteAcceptedToGuildApplicationsBotNotIn = 50036
  563. ErrCodeReactionBlocked = 90001
  564. )