structs.go 21 KB

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