structs.go 21 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. "encoding/json"
  12. "net/http"
  13. "strconv"
  14. "sync"
  15. "time"
  16. "github.com/gorilla/websocket"
  17. )
  18. // A Session represents a connection to the Discord API.
  19. type Session struct {
  20. sync.RWMutex
  21. // General configurable settings.
  22. // Authentication token for this session
  23. Token string
  24. MFA bool
  25. // Debug for printing JSON request/responses
  26. Debug bool // Deprecated, will be removed.
  27. LogLevel int
  28. // Should the session reconnect the websocket on errors.
  29. ShouldReconnectOnError bool
  30. // Should the session request compressed websocket data.
  31. Compress bool
  32. // Sharding
  33. ShardID int
  34. ShardCount int
  35. // Should state tracking be enabled.
  36. // State tracking is the best way for getting the the users
  37. // active guilds and the members of the guilds.
  38. StateEnabled bool
  39. // Whether or not to call event handlers synchronously.
  40. // e.g false = launch event handlers in their own goroutines.
  41. SyncEvents bool
  42. // Exposed but should not be modified by User.
  43. // Whether the Data Websocket is ready
  44. DataReady bool // NOTE: Maye be deprecated soon
  45. // Max number of REST API retries
  46. MaxRestRetries int
  47. // Status stores the currect status of the websocket connection
  48. // this is being tested, may stay, may go away.
  49. status int32
  50. // Whether the Voice Websocket is ready
  51. VoiceReady bool // NOTE: Deprecated.
  52. // Whether the UDP Connection is ready
  53. UDPReady bool // NOTE: Deprecated
  54. // Stores a mapping of guild id's to VoiceConnections
  55. VoiceConnections map[string]*VoiceConnection
  56. // Managed state object, updated internally with events when
  57. // StateEnabled is true.
  58. State *State
  59. // The http client used for REST requests
  60. Client *http.Client
  61. // Stores the last HeartbeatAck that was recieved (in UTC)
  62. LastHeartbeatAck time.Time
  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. // used to deal with rate limits
  72. ratelimiter *RateLimiter
  73. // sequence tracks the current gateway api websocket sequence number
  74. sequence *int64
  75. // stores sessions current Discord Gateway
  76. gateway string
  77. // stores session ID of current Gateway connection
  78. sessionID string
  79. // used to make sure gateway websocket writes do not happen concurrently
  80. wsMutex sync.Mutex
  81. }
  82. // A VoiceRegion stores data for a specific voice region server.
  83. type VoiceRegion struct {
  84. ID string `json:"id"`
  85. Name string `json:"name"`
  86. Hostname string `json:"sample_hostname"`
  87. Port int `json:"sample_port"`
  88. }
  89. // A VoiceICE stores data for voice ICE servers.
  90. type VoiceICE struct {
  91. TTL string `json:"ttl"`
  92. Servers []*ICEServer `json:"servers"`
  93. }
  94. // A ICEServer stores data for a specific voice ICE server.
  95. type ICEServer struct {
  96. URL string `json:"url"`
  97. Username string `json:"username"`
  98. Credential string `json:"credential"`
  99. }
  100. // A Invite stores all data related to a specific Discord Guild or Channel invite.
  101. type Invite struct {
  102. Guild *Guild `json:"guild"`
  103. Channel *Channel `json:"channel"`
  104. Inviter *User `json:"inviter"`
  105. Code string `json:"code"`
  106. CreatedAt Timestamp `json:"created_at"`
  107. MaxAge int `json:"max_age"`
  108. Uses int `json:"uses"`
  109. MaxUses int `json:"max_uses"`
  110. XkcdPass string `json:"xkcdpass"`
  111. Revoked bool `json:"revoked"`
  112. Temporary bool `json:"temporary"`
  113. }
  114. type ChannelType int
  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:"recipient"`
  134. Messages []*Message `json:"-"`
  135. PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites"`
  136. }
  137. // A PermissionOverwrite holds permission overwrite data for a Channel
  138. type PermissionOverwrite struct {
  139. ID string `json:"id"`
  140. Type string `json:"type"`
  141. Deny int `json:"deny"`
  142. Allow int `json:"allow"`
  143. }
  144. // Emoji struct holds data related to Emoji's
  145. type Emoji struct {
  146. ID string `json:"id"`
  147. Name string `json:"name"`
  148. Roles []string `json:"roles"`
  149. Managed bool `json:"managed"`
  150. RequireColons bool `json:"require_colons"`
  151. }
  152. // APIName returns an correctly formatted API name for use in the MessageReactions endpoints.
  153. func (e *Emoji) APIName() string {
  154. if e.ID != "" && e.Name != "" {
  155. return e.Name + ":" + e.ID
  156. }
  157. if e.Name != "" {
  158. return e.Name
  159. }
  160. return e.ID
  161. }
  162. // VerificationLevel type defination
  163. type VerificationLevel int
  164. // Constants for VerificationLevel levels from 0 to 3 inclusive
  165. const (
  166. VerificationLevelNone VerificationLevel = iota
  167. VerificationLevelLow
  168. VerificationLevelMedium
  169. VerificationLevelHigh
  170. )
  171. // A Guild holds all data related to a specific Discord Guild. Guilds are also
  172. // sometimes referred to as Servers in the Discord client.
  173. type Guild struct {
  174. ID string `json:"id"`
  175. Name string `json:"name"`
  176. Icon string `json:"icon"`
  177. Region string `json:"region"`
  178. AfkChannelID string `json:"afk_channel_id"`
  179. EmbedChannelID string `json:"embed_channel_id"`
  180. OwnerID string `json:"owner_id"`
  181. JoinedAt Timestamp `json:"joined_at"`
  182. Splash string `json:"splash"`
  183. AfkTimeout int `json:"afk_timeout"`
  184. MemberCount int `json:"member_count"`
  185. VerificationLevel VerificationLevel `json:"verification_level"`
  186. EmbedEnabled bool `json:"embed_enabled"`
  187. Large bool `json:"large"` // ??
  188. DefaultMessageNotifications int `json:"default_message_notifications"`
  189. Roles []*Role `json:"roles"`
  190. Emojis []*Emoji `json:"emojis"`
  191. Members []*Member `json:"members"`
  192. Presences []*Presence `json:"presences"`
  193. Channels []*Channel `json:"channels"`
  194. VoiceStates []*VoiceState `json:"voice_states"`
  195. Unavailable bool `json:"unavailable"`
  196. }
  197. // A UserGuild holds a brief version of a Guild
  198. type UserGuild struct {
  199. ID string `json:"id"`
  200. Name string `json:"name"`
  201. Icon string `json:"icon"`
  202. Owner bool `json:"owner"`
  203. Permissions int `json:"permissions"`
  204. }
  205. // A GuildParams stores all the data needed to update discord guild settings
  206. type GuildParams struct {
  207. Name string `json:"name,omitempty"`
  208. Region string `json:"region,omitempty"`
  209. VerificationLevel *VerificationLevel `json:"verification_level,omitempty"`
  210. DefaultMessageNotifications int `json:"default_message_notifications,omitempty"` // TODO: Separate type?
  211. AfkChannelID string `json:"afk_channel_id,omitempty"`
  212. AfkTimeout int `json:"afk_timeout,omitempty"`
  213. Icon string `json:"icon,omitempty"`
  214. OwnerID string `json:"owner_id,omitempty"`
  215. Splash string `json:"splash,omitempty"`
  216. }
  217. // A Role stores information about Discord guild member roles.
  218. type Role struct {
  219. ID string `json:"id"`
  220. Name string `json:"name"`
  221. Managed bool `json:"managed"`
  222. Mentionable bool `json:"mentionable"`
  223. Hoist bool `json:"hoist"`
  224. Color int `json:"color"`
  225. Position int `json:"position"`
  226. Permissions int `json:"permissions"`
  227. }
  228. // Roles are a collection of Role
  229. type Roles []*Role
  230. func (r Roles) Len() int {
  231. return len(r)
  232. }
  233. func (r Roles) Less(i, j int) bool {
  234. return r[i].Position > r[j].Position
  235. }
  236. func (r Roles) Swap(i, j int) {
  237. r[i], r[j] = r[j], r[i]
  238. }
  239. // A VoiceState stores the voice states of Guilds
  240. type VoiceState struct {
  241. UserID string `json:"user_id"`
  242. SessionID string `json:"session_id"`
  243. ChannelID string `json:"channel_id"`
  244. GuildID string `json:"guild_id"`
  245. Suppress bool `json:"suppress"`
  246. SelfMute bool `json:"self_mute"`
  247. SelfDeaf bool `json:"self_deaf"`
  248. Mute bool `json:"mute"`
  249. Deaf bool `json:"deaf"`
  250. }
  251. // A Presence stores the online, offline, or idle and game status of Guild members.
  252. type Presence struct {
  253. User *User `json:"user"`
  254. Status Status `json:"status"`
  255. Game *Game `json:"game"`
  256. Nick string `json:"nick"`
  257. Roles []string `json:"roles"`
  258. Since *int `json:"since"`
  259. }
  260. // A Game struct holds the name of the "playing .." game for a user
  261. type Game struct {
  262. Name string `json:"name"`
  263. Type int `json:"type"`
  264. URL string `json:"url,omitempty"`
  265. }
  266. // UnmarshalJSON unmarshals json to Game struct
  267. func (g *Game) UnmarshalJSON(bytes []byte) error {
  268. temp := &struct {
  269. Name json.Number `json:"name"`
  270. Type json.RawMessage `json:"type"`
  271. URL string `json:"url"`
  272. }{}
  273. err := json.Unmarshal(bytes, temp)
  274. if err != nil {
  275. return err
  276. }
  277. g.URL = temp.URL
  278. g.Name = temp.Name.String()
  279. if temp.Type != nil {
  280. err = json.Unmarshal(temp.Type, &g.Type)
  281. if err == nil {
  282. return nil
  283. }
  284. s := ""
  285. err = json.Unmarshal(temp.Type, &s)
  286. if err == nil {
  287. g.Type, err = strconv.Atoi(s)
  288. }
  289. return err
  290. }
  291. return nil
  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. 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. )