structs.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  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. // ChannelType is the type of a Channel
  115. type ChannelType int
  116. // Block contains known ChannelType values
  117. const (
  118. ChannelTypeGuildText ChannelType = iota
  119. ChannelTypeDM
  120. ChannelTypeGuildVoice
  121. ChannelTypeGroupDM
  122. ChannelTypeGuildCategory
  123. )
  124. // A Channel holds all data related to an individual Discord channel.
  125. type Channel struct {
  126. ID string `json:"id"`
  127. GuildID string `json:"guild_id"`
  128. Name string `json:"name"`
  129. Topic string `json:"topic"`
  130. Type ChannelType `json:"type"`
  131. LastMessageID string `json:"last_message_id"`
  132. NSFW bool `json:"nsfw"`
  133. Position int `json:"position"`
  134. Bitrate int `json:"bitrate"`
  135. Recipients []*User `json:"recipients"`
  136. Messages []*Message `json:"-"`
  137. PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites"`
  138. ParentID string `json:"parent_id"`
  139. }
  140. // A PermissionOverwrite holds permission overwrite data for a Channel
  141. type PermissionOverwrite struct {
  142. ID string `json:"id"`
  143. Type string `json:"type"`
  144. Deny int `json:"deny"`
  145. Allow int `json:"allow"`
  146. }
  147. // Emoji struct holds data related to Emoji's
  148. type Emoji struct {
  149. ID string `json:"id"`
  150. Name string `json:"name"`
  151. Roles []string `json:"roles"`
  152. Managed bool `json:"managed"`
  153. RequireColons bool `json:"require_colons"`
  154. }
  155. // APIName returns an correctly formatted API name for use in the MessageReactions endpoints.
  156. func (e *Emoji) APIName() string {
  157. if e.ID != "" && e.Name != "" {
  158. return e.Name + ":" + e.ID
  159. }
  160. if e.Name != "" {
  161. return e.Name
  162. }
  163. return e.ID
  164. }
  165. // VerificationLevel type defination
  166. type VerificationLevel int
  167. // Constants for VerificationLevel levels from 0 to 3 inclusive
  168. const (
  169. VerificationLevelNone VerificationLevel = iota
  170. VerificationLevelLow
  171. VerificationLevelMedium
  172. VerificationLevelHigh
  173. )
  174. // A Guild holds all data related to a specific Discord Guild. Guilds are also
  175. // sometimes referred to as Servers in the Discord client.
  176. type Guild struct {
  177. ID string `json:"id"`
  178. Name string `json:"name"`
  179. Icon string `json:"icon"`
  180. Region string `json:"region"`
  181. AfkChannelID string `json:"afk_channel_id"`
  182. EmbedChannelID string `json:"embed_channel_id"`
  183. OwnerID string `json:"owner_id"`
  184. JoinedAt Timestamp `json:"joined_at"`
  185. Splash string `json:"splash"`
  186. AfkTimeout int `json:"afk_timeout"`
  187. MemberCount int `json:"member_count"`
  188. VerificationLevel VerificationLevel `json:"verification_level"`
  189. EmbedEnabled bool `json:"embed_enabled"`
  190. Large bool `json:"large"` // ??
  191. DefaultMessageNotifications int `json:"default_message_notifications"`
  192. Roles []*Role `json:"roles"`
  193. Emojis []*Emoji `json:"emojis"`
  194. Members []*Member `json:"members"`
  195. Presences []*Presence `json:"presences"`
  196. Channels []*Channel `json:"channels"`
  197. VoiceStates []*VoiceState `json:"voice_states"`
  198. Unavailable bool `json:"unavailable"`
  199. }
  200. // A UserGuild holds a brief version of a Guild
  201. type UserGuild struct {
  202. ID string `json:"id"`
  203. Name string `json:"name"`
  204. Icon string `json:"icon"`
  205. Owner bool `json:"owner"`
  206. Permissions int `json:"permissions"`
  207. }
  208. // A GuildParams stores all the data needed to update discord guild settings
  209. type GuildParams struct {
  210. Name string `json:"name,omitempty"`
  211. Region string `json:"region,omitempty"`
  212. VerificationLevel *VerificationLevel `json:"verification_level,omitempty"`
  213. DefaultMessageNotifications int `json:"default_message_notifications,omitempty"` // TODO: Separate type?
  214. AfkChannelID string `json:"afk_channel_id,omitempty"`
  215. AfkTimeout int `json:"afk_timeout,omitempty"`
  216. Icon string `json:"icon,omitempty"`
  217. OwnerID string `json:"owner_id,omitempty"`
  218. Splash string `json:"splash,omitempty"`
  219. }
  220. // A Role stores information about Discord guild member roles.
  221. type Role struct {
  222. ID string `json:"id"`
  223. Name string `json:"name"`
  224. Managed bool `json:"managed"`
  225. Mentionable bool `json:"mentionable"`
  226. Hoist bool `json:"hoist"`
  227. Color int `json:"color"`
  228. Position int `json:"position"`
  229. Permissions int `json:"permissions"`
  230. }
  231. // Roles are a collection of Role
  232. type Roles []*Role
  233. func (r Roles) Len() int {
  234. return len(r)
  235. }
  236. func (r Roles) Less(i, j int) bool {
  237. return r[i].Position > r[j].Position
  238. }
  239. func (r Roles) Swap(i, j int) {
  240. r[i], r[j] = r[j], r[i]
  241. }
  242. // A VoiceState stores the voice states of Guilds
  243. type VoiceState struct {
  244. UserID string `json:"user_id"`
  245. SessionID string `json:"session_id"`
  246. ChannelID string `json:"channel_id"`
  247. GuildID string `json:"guild_id"`
  248. Suppress bool `json:"suppress"`
  249. SelfMute bool `json:"self_mute"`
  250. SelfDeaf bool `json:"self_deaf"`
  251. Mute bool `json:"mute"`
  252. Deaf bool `json:"deaf"`
  253. }
  254. // A Presence stores the online, offline, or idle and game status of Guild members.
  255. type Presence struct {
  256. User *User `json:"user"`
  257. Status Status `json:"status"`
  258. Game *Game `json:"game"`
  259. Nick string `json:"nick"`
  260. Roles []string `json:"roles"`
  261. Since *int `json:"since"`
  262. }
  263. // A Game struct holds the name of the "playing .." game for a user
  264. type Game struct {
  265. Name string `json:"name"`
  266. Type int `json:"type"`
  267. URL string `json:"url,omitempty"`
  268. }
  269. // UnmarshalJSON unmarshals json to Game struct
  270. func (g *Game) UnmarshalJSON(bytes []byte) error {
  271. temp := &struct {
  272. Name json.Number `json:"name"`
  273. Type json.RawMessage `json:"type"`
  274. URL string `json:"url"`
  275. }{}
  276. err := json.Unmarshal(bytes, temp)
  277. if err != nil {
  278. return err
  279. }
  280. g.URL = temp.URL
  281. g.Name = temp.Name.String()
  282. if temp.Type != nil {
  283. err = json.Unmarshal(temp.Type, &g.Type)
  284. if err == nil {
  285. return nil
  286. }
  287. s := ""
  288. err = json.Unmarshal(temp.Type, &s)
  289. if err == nil {
  290. g.Type, err = strconv.Atoi(s)
  291. }
  292. return err
  293. }
  294. return nil
  295. }
  296. // A Member stores user information for Guild members.
  297. type Member struct {
  298. GuildID string `json:"guild_id"`
  299. JoinedAt string `json:"joined_at"`
  300. Nick string `json:"nick"`
  301. Deaf bool `json:"deaf"`
  302. Mute bool `json:"mute"`
  303. User *User `json:"user"`
  304. Roles []string `json:"roles"`
  305. }
  306. // A Settings stores data for a specific users Discord client settings.
  307. type Settings struct {
  308. RenderEmbeds bool `json:"render_embeds"`
  309. InlineEmbedMedia bool `json:"inline_embed_media"`
  310. InlineAttachmentMedia bool `json:"inline_attachment_media"`
  311. EnableTtsCommand bool `json:"enable_tts_command"`
  312. MessageDisplayCompact bool `json:"message_display_compact"`
  313. ShowCurrentGame bool `json:"show_current_game"`
  314. ConvertEmoticons bool `json:"convert_emoticons"`
  315. Locale string `json:"locale"`
  316. Theme string `json:"theme"`
  317. GuildPositions []string `json:"guild_positions"`
  318. RestrictedGuilds []string `json:"restricted_guilds"`
  319. FriendSourceFlags *FriendSourceFlags `json:"friend_source_flags"`
  320. Status Status `json:"status"`
  321. DetectPlatformAccounts bool `json:"detect_platform_accounts"`
  322. DeveloperMode bool `json:"developer_mode"`
  323. }
  324. // Status type defination
  325. type Status string
  326. // Constants for Status with the different current available status
  327. const (
  328. StatusOnline Status = "online"
  329. StatusIdle Status = "idle"
  330. StatusDoNotDisturb Status = "dnd"
  331. StatusInvisible Status = "invisible"
  332. StatusOffline Status = "offline"
  333. )
  334. // FriendSourceFlags stores ... TODO :)
  335. type FriendSourceFlags struct {
  336. All bool `json:"all"`
  337. MutualGuilds bool `json:"mutual_guilds"`
  338. MutualFriends bool `json:"mutual_friends"`
  339. }
  340. // A Relationship between the logged in user and Relationship.User
  341. type Relationship struct {
  342. User *User `json:"user"`
  343. Type int `json:"type"` // 1 = friend, 2 = blocked, 3 = incoming friend req, 4 = sent friend req
  344. ID string `json:"id"`
  345. }
  346. // A TooManyRequests struct holds information received from Discord
  347. // when receiving a HTTP 429 response.
  348. type TooManyRequests struct {
  349. Bucket string `json:"bucket"`
  350. Message string `json:"message"`
  351. RetryAfter time.Duration `json:"retry_after"`
  352. }
  353. // A ReadState stores data on the read state of channels.
  354. type ReadState struct {
  355. MentionCount int `json:"mention_count"`
  356. LastMessageID string `json:"last_message_id"`
  357. ID string `json:"id"`
  358. }
  359. // An Ack is used to ack messages
  360. type Ack struct {
  361. Token string `json:"token"`
  362. }
  363. // A GuildRole stores data for guild roles.
  364. type GuildRole struct {
  365. Role *Role `json:"role"`
  366. GuildID string `json:"guild_id"`
  367. }
  368. // A GuildBan stores data for a guild ban.
  369. type GuildBan struct {
  370. Reason string `json:"reason"`
  371. User *User `json:"user"`
  372. }
  373. // A GuildIntegration stores data for a guild integration.
  374. type GuildIntegration struct {
  375. ID string `json:"id"`
  376. Name string `json:"name"`
  377. Type string `json:"type"`
  378. Enabled bool `json:"enabled"`
  379. Syncing bool `json:"syncing"`
  380. RoleID string `json:"role_id"`
  381. ExpireBehavior int `json:"expire_behavior"`
  382. ExpireGracePeriod int `json:"expire_grace_period"`
  383. User *User `json:"user"`
  384. Account *GuildIntegrationAccount `json:"account"`
  385. SyncedAt int `json:"synced_at"`
  386. }
  387. // A GuildIntegrationAccount stores data for a guild integration account.
  388. type GuildIntegrationAccount struct {
  389. ID string `json:"id"`
  390. Name string `json:"name"`
  391. }
  392. // A GuildEmbed stores data for a guild embed.
  393. type GuildEmbed struct {
  394. Enabled bool `json:"enabled"`
  395. ChannelID string `json:"channel_id"`
  396. }
  397. // A UserGuildSettingsChannelOverride stores data for a channel override for a users guild settings.
  398. type UserGuildSettingsChannelOverride struct {
  399. Muted bool `json:"muted"`
  400. MessageNotifications int `json:"message_notifications"`
  401. ChannelID string `json:"channel_id"`
  402. }
  403. // A UserGuildSettings stores data for a users guild settings.
  404. type UserGuildSettings struct {
  405. SupressEveryone bool `json:"suppress_everyone"`
  406. Muted bool `json:"muted"`
  407. MobilePush bool `json:"mobile_push"`
  408. MessageNotifications int `json:"message_notifications"`
  409. GuildID string `json:"guild_id"`
  410. ChannelOverrides []*UserGuildSettingsChannelOverride `json:"channel_overrides"`
  411. }
  412. // A UserGuildSettingsEdit stores data for editing UserGuildSettings
  413. type UserGuildSettingsEdit struct {
  414. SupressEveryone bool `json:"suppress_everyone"`
  415. Muted bool `json:"muted"`
  416. MobilePush bool `json:"mobile_push"`
  417. MessageNotifications int `json:"message_notifications"`
  418. ChannelOverrides map[string]*UserGuildSettingsChannelOverride `json:"channel_overrides"`
  419. }
  420. // An APIErrorMessage is an api error message returned from discord
  421. type APIErrorMessage struct {
  422. Code int `json:"code"`
  423. Message string `json:"message"`
  424. }
  425. // Webhook stores the data for a webhook.
  426. type Webhook struct {
  427. ID string `json:"id"`
  428. GuildID string `json:"guild_id"`
  429. ChannelID string `json:"channel_id"`
  430. User *User `json:"user"`
  431. Name string `json:"name"`
  432. Avatar string `json:"avatar"`
  433. Token string `json:"token"`
  434. }
  435. // WebhookParams is a struct for webhook params, used in the WebhookExecute command.
  436. type WebhookParams struct {
  437. Content string `json:"content,omitempty"`
  438. Username string `json:"username,omitempty"`
  439. AvatarURL string `json:"avatar_url,omitempty"`
  440. TTS bool `json:"tts,omitempty"`
  441. File string `json:"file,omitempty"`
  442. Embeds []*MessageEmbed `json:"embeds,omitempty"`
  443. }
  444. // MessageReaction stores the data for a message reaction.
  445. type MessageReaction struct {
  446. UserID string `json:"user_id"`
  447. MessageID string `json:"message_id"`
  448. Emoji Emoji `json:"emoji"`
  449. ChannelID string `json:"channel_id"`
  450. }
  451. // GatewayBotResponse stores the data for the gateway/bot response
  452. type GatewayBotResponse struct {
  453. URL string `json:"url"`
  454. Shards int `json:"shards"`
  455. }
  456. // Constants for the different bit offsets of text channel permissions
  457. const (
  458. PermissionReadMessages = 1 << (iota + 10)
  459. PermissionSendMessages
  460. PermissionSendTTSMessages
  461. PermissionManageMessages
  462. PermissionEmbedLinks
  463. PermissionAttachFiles
  464. PermissionReadMessageHistory
  465. PermissionMentionEveryone
  466. PermissionUseExternalEmojis
  467. )
  468. // Constants for the different bit offsets of voice permissions
  469. const (
  470. PermissionVoiceConnect = 1 << (iota + 20)
  471. PermissionVoiceSpeak
  472. PermissionVoiceMuteMembers
  473. PermissionVoiceDeafenMembers
  474. PermissionVoiceMoveMembers
  475. PermissionVoiceUseVAD
  476. )
  477. // Constants for general management.
  478. const (
  479. PermissionChangeNickname = 1 << (iota + 26)
  480. PermissionManageNicknames
  481. PermissionManageRoles
  482. PermissionManageWebhooks
  483. PermissionManageEmojis
  484. )
  485. // Constants for the different bit offsets of general permissions
  486. const (
  487. PermissionCreateInstantInvite = 1 << iota
  488. PermissionKickMembers
  489. PermissionBanMembers
  490. PermissionAdministrator
  491. PermissionManageChannels
  492. PermissionManageServer
  493. PermissionAddReactions
  494. PermissionViewAuditLogs
  495. PermissionAllText = PermissionReadMessages |
  496. PermissionSendMessages |
  497. PermissionSendTTSMessages |
  498. PermissionManageMessages |
  499. PermissionEmbedLinks |
  500. PermissionAttachFiles |
  501. PermissionReadMessageHistory |
  502. PermissionMentionEveryone
  503. PermissionAllVoice = PermissionVoiceConnect |
  504. PermissionVoiceSpeak |
  505. PermissionVoiceMuteMembers |
  506. PermissionVoiceDeafenMembers |
  507. PermissionVoiceMoveMembers |
  508. PermissionVoiceUseVAD
  509. PermissionAllChannel = PermissionAllText |
  510. PermissionAllVoice |
  511. PermissionCreateInstantInvite |
  512. PermissionManageRoles |
  513. PermissionManageChannels |
  514. PermissionAddReactions |
  515. PermissionViewAuditLogs
  516. PermissionAll = PermissionAllChannel |
  517. PermissionKickMembers |
  518. PermissionBanMembers |
  519. PermissionManageServer |
  520. PermissionAdministrator
  521. )
  522. // Block contains Discord JSON Error Response codes
  523. const (
  524. ErrCodeUnknownAccount = 10001
  525. ErrCodeUnknownApplication = 10002
  526. ErrCodeUnknownChannel = 10003
  527. ErrCodeUnknownGuild = 10004
  528. ErrCodeUnknownIntegration = 10005
  529. ErrCodeUnknownInvite = 10006
  530. ErrCodeUnknownMember = 10007
  531. ErrCodeUnknownMessage = 10008
  532. ErrCodeUnknownOverwrite = 10009
  533. ErrCodeUnknownProvider = 10010
  534. ErrCodeUnknownRole = 10011
  535. ErrCodeUnknownToken = 10012
  536. ErrCodeUnknownUser = 10013
  537. ErrCodeUnknownEmoji = 10014
  538. ErrCodeBotsCannotUseEndpoint = 20001
  539. ErrCodeOnlyBotsCanUseEndpoint = 20002
  540. ErrCodeMaximumGuildsReached = 30001
  541. ErrCodeMaximumFriendsReached = 30002
  542. ErrCodeMaximumPinsReached = 30003
  543. ErrCodeMaximumGuildRolesReached = 30005
  544. ErrCodeTooManyReactions = 30010
  545. ErrCodeUnauthorized = 40001
  546. ErrCodeMissingAccess = 50001
  547. ErrCodeInvalidAccountType = 50002
  548. ErrCodeCannotExecuteActionOnDMChannel = 50003
  549. ErrCodeEmbedCisabled = 50004
  550. ErrCodeCannotEditFromAnotherUser = 50005
  551. ErrCodeCannotSendEmptyMessage = 50006
  552. ErrCodeCannotSendMessagesToThisUser = 50007
  553. ErrCodeCannotSendMessagesInVoiceChannel = 50008
  554. ErrCodeChannelVerificationLevelTooHigh = 50009
  555. ErrCodeOAuth2ApplicationDoesNotHaveBot = 50010
  556. ErrCodeOAuth2ApplicationLimitReached = 50011
  557. ErrCodeInvalidOAuthState = 50012
  558. ErrCodeMissingPermissions = 50013
  559. ErrCodeInvalidAuthenticationToken = 50014
  560. ErrCodeNoteTooLong = 50015
  561. ErrCodeTooFewOrTooManyMessagesToDelete = 50016
  562. ErrCodeCanOnlyPinMessageToOriginatingChannel = 50019
  563. ErrCodeCannotExecuteActionOnSystemMessage = 50021
  564. ErrCodeMessageProvidedTooOldForBulkDelete = 50034
  565. ErrCodeInvalidFormBody = 50035
  566. ErrCodeInviteAcceptedToGuildApplicationsBotNotIn = 50036
  567. ErrCodeReactionBlocked = 90001
  568. )