discord-selfbot-v13.js 0.0.1-security → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of discord-selfbot-v13.js might be problematic. Click here for more details.

Files changed (343) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +119 -5
  3. package/package.json +101 -6
  4. package/src/WebSocket.js +39 -0
  5. package/src/client/BaseClient.js +87 -0
  6. package/src/client/Client.js +1154 -0
  7. package/src/client/WebhookClient.js +61 -0
  8. package/src/client/actions/Action.js +115 -0
  9. package/src/client/actions/ActionsManager.js +72 -0
  10. package/src/client/actions/ApplicationCommandPermissionsUpdate.js +34 -0
  11. package/src/client/actions/AutoModerationActionExecution.js +26 -0
  12. package/src/client/actions/AutoModerationRuleCreate.js +27 -0
  13. package/src/client/actions/AutoModerationRuleDelete.js +31 -0
  14. package/src/client/actions/AutoModerationRuleUpdate.js +29 -0
  15. package/src/client/actions/ChannelCreate.js +23 -0
  16. package/src/client/actions/ChannelDelete.js +39 -0
  17. package/src/client/actions/ChannelUpdate.js +34 -0
  18. package/src/client/actions/GuildAuditLogEntryCreate.js +29 -0
  19. package/src/client/actions/GuildBanAdd.js +20 -0
  20. package/src/client/actions/GuildBanRemove.js +25 -0
  21. package/src/client/actions/GuildChannelsPositionUpdate.js +21 -0
  22. package/src/client/actions/GuildDelete.js +65 -0
  23. package/src/client/actions/GuildEmojiCreate.js +20 -0
  24. package/src/client/actions/GuildEmojiDelete.js +21 -0
  25. package/src/client/actions/GuildEmojiUpdate.js +20 -0
  26. package/src/client/actions/GuildEmojisUpdate.js +34 -0
  27. package/src/client/actions/GuildIntegrationsUpdate.js +19 -0
  28. package/src/client/actions/GuildMemberRemove.js +33 -0
  29. package/src/client/actions/GuildMemberUpdate.js +44 -0
  30. package/src/client/actions/GuildRoleCreate.js +25 -0
  31. package/src/client/actions/GuildRoleDelete.js +31 -0
  32. package/src/client/actions/GuildRoleUpdate.js +39 -0
  33. package/src/client/actions/GuildRolesPositionUpdate.js +21 -0
  34. package/src/client/actions/GuildScheduledEventCreate.js +27 -0
  35. package/src/client/actions/GuildScheduledEventDelete.js +31 -0
  36. package/src/client/actions/GuildScheduledEventUpdate.js +30 -0
  37. package/src/client/actions/GuildScheduledEventUserAdd.js +32 -0
  38. package/src/client/actions/GuildScheduledEventUserRemove.js +32 -0
  39. package/src/client/actions/GuildStickerCreate.js +20 -0
  40. package/src/client/actions/GuildStickerDelete.js +21 -0
  41. package/src/client/actions/GuildStickerUpdate.js +20 -0
  42. package/src/client/actions/GuildStickersUpdate.js +34 -0
  43. package/src/client/actions/GuildUpdate.js +33 -0
  44. package/src/client/actions/InteractionCreate.js +115 -0
  45. package/src/client/actions/InviteCreate.js +28 -0
  46. package/src/client/actions/InviteDelete.js +30 -0
  47. package/src/client/actions/MessageCreate.js +50 -0
  48. package/src/client/actions/MessageDelete.js +32 -0
  49. package/src/client/actions/MessageDeleteBulk.js +46 -0
  50. package/src/client/actions/MessageReactionAdd.js +56 -0
  51. package/src/client/actions/MessageReactionRemove.js +45 -0
  52. package/src/client/actions/MessageReactionRemoveAll.js +33 -0
  53. package/src/client/actions/MessageReactionRemoveEmoji.js +28 -0
  54. package/src/client/actions/MessageUpdate.js +26 -0
  55. package/src/client/actions/PresenceUpdate.js +45 -0
  56. package/src/client/actions/StageInstanceCreate.js +28 -0
  57. package/src/client/actions/StageInstanceDelete.js +33 -0
  58. package/src/client/actions/StageInstanceUpdate.js +30 -0
  59. package/src/client/actions/ThreadCreate.js +24 -0
  60. package/src/client/actions/ThreadDelete.js +32 -0
  61. package/src/client/actions/ThreadListSync.js +59 -0
  62. package/src/client/actions/ThreadMemberUpdate.js +30 -0
  63. package/src/client/actions/ThreadMembersUpdate.js +34 -0
  64. package/src/client/actions/TypingStart.js +29 -0
  65. package/src/client/actions/UserUpdate.js +35 -0
  66. package/src/client/actions/VoiceStateUpdate.js +57 -0
  67. package/src/client/actions/WebhooksUpdate.js +20 -0
  68. package/src/client/voice/ClientVoiceManager.js +51 -0
  69. package/src/client/websocket/WebSocketManager.js +412 -0
  70. package/src/client/websocket/WebSocketShard.js +908 -0
  71. package/src/client/websocket/handlers/APPLICATION_COMMAND_AUTOCOMPLETE_RESPONSE.js +23 -0
  72. package/src/client/websocket/handlers/APPLICATION_COMMAND_CREATE.js +18 -0
  73. package/src/client/websocket/handlers/APPLICATION_COMMAND_DELETE.js +20 -0
  74. package/src/client/websocket/handlers/APPLICATION_COMMAND_PERMISSIONS_UPDATE.js +5 -0
  75. package/src/client/websocket/handlers/APPLICATION_COMMAND_UPDATE.js +20 -0
  76. package/src/client/websocket/handlers/AUTO_MODERATION_ACTION_EXECUTION.js +5 -0
  77. package/src/client/websocket/handlers/AUTO_MODERATION_RULE_CREATE.js +5 -0
  78. package/src/client/websocket/handlers/AUTO_MODERATION_RULE_DELETE.js +5 -0
  79. package/src/client/websocket/handlers/AUTO_MODERATION_RULE_UPDATE.js +5 -0
  80. package/src/client/websocket/handlers/CALL_CREATE.js +14 -0
  81. package/src/client/websocket/handlers/CALL_DELETE.js +11 -0
  82. package/src/client/websocket/handlers/CALL_UPDATE.js +11 -0
  83. package/src/client/websocket/handlers/CHANNEL_CREATE.js +5 -0
  84. package/src/client/websocket/handlers/CHANNEL_DELETE.js +5 -0
  85. package/src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js +22 -0
  86. package/src/client/websocket/handlers/CHANNEL_RECIPIENT_ADD.js +16 -0
  87. package/src/client/websocket/handlers/CHANNEL_RECIPIENT_REMOVE.js +16 -0
  88. package/src/client/websocket/handlers/CHANNEL_UPDATE.js +16 -0
  89. package/src/client/websocket/handlers/GUILD_APPLICATION_COMMANDS_UPDATE.js +11 -0
  90. package/src/client/websocket/handlers/GUILD_AUDIT_LOG_ENTRY_CREATE.js +5 -0
  91. package/src/client/websocket/handlers/GUILD_BAN_ADD.js +5 -0
  92. package/src/client/websocket/handlers/GUILD_BAN_REMOVE.js +5 -0
  93. package/src/client/websocket/handlers/GUILD_CREATE.js +46 -0
  94. package/src/client/websocket/handlers/GUILD_DELETE.js +5 -0
  95. package/src/client/websocket/handlers/GUILD_EMOJIS_UPDATE.js +5 -0
  96. package/src/client/websocket/handlers/GUILD_INTEGRATIONS_UPDATE.js +5 -0
  97. package/src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js +39 -0
  98. package/src/client/websocket/handlers/GUILD_MEMBER_ADD.js +20 -0
  99. package/src/client/websocket/handlers/GUILD_MEMBER_LIST_UPDATE.js +55 -0
  100. package/src/client/websocket/handlers/GUILD_MEMBER_REMOVE.js +5 -0
  101. package/src/client/websocket/handlers/GUILD_MEMBER_UPDATE.js +5 -0
  102. package/src/client/websocket/handlers/GUILD_ROLE_CREATE.js +5 -0
  103. package/src/client/websocket/handlers/GUILD_ROLE_DELETE.js +5 -0
  104. package/src/client/websocket/handlers/GUILD_ROLE_UPDATE.js +5 -0
  105. package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_CREATE.js +5 -0
  106. package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_DELETE.js +5 -0
  107. package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_UPDATE.js +5 -0
  108. package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_ADD.js +5 -0
  109. package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_REMOVE.js +5 -0
  110. package/src/client/websocket/handlers/GUILD_STICKERS_UPDATE.js +5 -0
  111. package/src/client/websocket/handlers/GUILD_UPDATE.js +5 -0
  112. package/src/client/websocket/handlers/INTERACTION_CREATE.js +16 -0
  113. package/src/client/websocket/handlers/INTERACTION_FAILURE.js +18 -0
  114. package/src/client/websocket/handlers/INTERACTION_MODAL_CREATE.js +11 -0
  115. package/src/client/websocket/handlers/INTERACTION_SUCCESS.js +30 -0
  116. package/src/client/websocket/handlers/INVITE_CREATE.js +5 -0
  117. package/src/client/websocket/handlers/INVITE_DELETE.js +5 -0
  118. package/src/client/websocket/handlers/MESSAGE_ACK.js +16 -0
  119. package/src/client/websocket/handlers/MESSAGE_CREATE.js +5 -0
  120. package/src/client/websocket/handlers/MESSAGE_DELETE.js +5 -0
  121. package/src/client/websocket/handlers/MESSAGE_DELETE_BULK.js +5 -0
  122. package/src/client/websocket/handlers/MESSAGE_REACTION_ADD.js +5 -0
  123. package/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE.js +5 -0
  124. package/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_ALL.js +5 -0
  125. package/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_EMOJI.js +5 -0
  126. package/src/client/websocket/handlers/MESSAGE_UPDATE.js +16 -0
  127. package/src/client/websocket/handlers/PRESENCE_UPDATE.js +5 -0
  128. package/src/client/websocket/handlers/READY.js +172 -0
  129. package/src/client/websocket/handlers/RELATIONSHIP_ADD.js +17 -0
  130. package/src/client/websocket/handlers/RELATIONSHIP_REMOVE.js +15 -0
  131. package/src/client/websocket/handlers/RELATIONSHIP_UPDATE.js +18 -0
  132. package/src/client/websocket/handlers/RESUMED.js +14 -0
  133. package/src/client/websocket/handlers/STAGE_INSTANCE_CREATE.js +5 -0
  134. package/src/client/websocket/handlers/STAGE_INSTANCE_DELETE.js +5 -0
  135. package/src/client/websocket/handlers/STAGE_INSTANCE_UPDATE.js +5 -0
  136. package/src/client/websocket/handlers/THREAD_CREATE.js +5 -0
  137. package/src/client/websocket/handlers/THREAD_DELETE.js +5 -0
  138. package/src/client/websocket/handlers/THREAD_LIST_SYNC.js +5 -0
  139. package/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js +5 -0
  140. package/src/client/websocket/handlers/THREAD_MEMBER_UPDATE.js +5 -0
  141. package/src/client/websocket/handlers/THREAD_UPDATE.js +16 -0
  142. package/src/client/websocket/handlers/TYPING_START.js +5 -0
  143. package/src/client/websocket/handlers/USER_GUILD_SETTINGS_UPDATE.js +12 -0
  144. package/src/client/websocket/handlers/USER_NOTE_UPDATE.js +5 -0
  145. package/src/client/websocket/handlers/USER_SETTINGS_UPDATE.js +9 -0
  146. package/src/client/websocket/handlers/USER_UPDATE.js +5 -0
  147. package/src/client/websocket/handlers/VOICE_SERVER_UPDATE.js +6 -0
  148. package/src/client/websocket/handlers/VOICE_STATE_UPDATE.js +5 -0
  149. package/src/client/websocket/handlers/WEBHOOKS_UPDATE.js +5 -0
  150. package/src/client/websocket/handlers/index.js +86 -0
  151. package/src/errors/DJSError.js +61 -0
  152. package/src/errors/Messages.js +227 -0
  153. package/src/errors/index.js +4 -0
  154. package/src/index.js +190 -0
  155. package/src/main.js +42 -0
  156. package/src/managers/ApplicationCommandManager.js +267 -0
  157. package/src/managers/ApplicationCommandPermissionsManager.js +425 -0
  158. package/src/managers/AutoModerationRuleManager.js +296 -0
  159. package/src/managers/BaseGuildEmojiManager.js +80 -0
  160. package/src/managers/BaseManager.js +19 -0
  161. package/src/managers/BillingManager.js +66 -0
  162. package/src/managers/CachedManager.js +71 -0
  163. package/src/managers/ChannelManager.js +139 -0
  164. package/src/managers/ClientUserSettingManager.js +490 -0
  165. package/src/managers/DataManager.js +61 -0
  166. package/src/managers/DeveloperPortalManager.js +104 -0
  167. package/src/managers/GuildApplicationCommandManager.js +28 -0
  168. package/src/managers/GuildBanManager.js +204 -0
  169. package/src/managers/GuildChannelManager.js +502 -0
  170. package/src/managers/GuildEmojiManager.js +171 -0
  171. package/src/managers/GuildEmojiRoleManager.js +118 -0
  172. package/src/managers/GuildFolderManager.js +24 -0
  173. package/src/managers/GuildForumThreadManager.js +114 -0
  174. package/src/managers/GuildInviteManager.js +213 -0
  175. package/src/managers/GuildManager.js +304 -0
  176. package/src/managers/GuildMemberManager.js +724 -0
  177. package/src/managers/GuildMemberRoleManager.js +191 -0
  178. package/src/managers/GuildScheduledEventManager.js +296 -0
  179. package/src/managers/GuildSettingManager.js +148 -0
  180. package/src/managers/GuildStickerManager.js +179 -0
  181. package/src/managers/GuildTextThreadManager.js +98 -0
  182. package/src/managers/InteractionManager.js +39 -0
  183. package/src/managers/MessageManager.js +393 -0
  184. package/src/managers/PermissionOverwriteManager.js +166 -0
  185. package/src/managers/PresenceManager.js +58 -0
  186. package/src/managers/ReactionManager.js +67 -0
  187. package/src/managers/ReactionUserManager.js +71 -0
  188. package/src/managers/RelationshipManager.js +258 -0
  189. package/src/managers/RoleManager.js +352 -0
  190. package/src/managers/SessionManager.js +57 -0
  191. package/src/managers/StageInstanceManager.js +162 -0
  192. package/src/managers/ThreadManager.js +207 -0
  193. package/src/managers/ThreadMemberManager.js +186 -0
  194. package/src/managers/UserManager.js +150 -0
  195. package/src/managers/VoiceStateManager.js +37 -0
  196. package/src/rest/APIRequest.js +136 -0
  197. package/src/rest/APIRouter.js +53 -0
  198. package/src/rest/CaptchaSolver.js +78 -0
  199. package/src/rest/DiscordAPIError.js +103 -0
  200. package/src/rest/HTTPError.js +62 -0
  201. package/src/rest/RESTManager.js +81 -0
  202. package/src/rest/RateLimitError.js +55 -0
  203. package/src/rest/RequestHandler.js +446 -0
  204. package/src/sharding/Shard.js +443 -0
  205. package/src/sharding/ShardClientUtil.js +275 -0
  206. package/src/sharding/ShardingManager.js +318 -0
  207. package/src/structures/AnonymousGuild.js +98 -0
  208. package/src/structures/ApplicationCommand.js +1028 -0
  209. package/src/structures/ApplicationRoleConnectionMetadata.js +45 -0
  210. package/src/structures/AutoModerationActionExecution.js +89 -0
  211. package/src/structures/AutoModerationRule.js +294 -0
  212. package/src/structures/AutocompleteInteraction.js +106 -0
  213. package/src/structures/Base.js +43 -0
  214. package/src/structures/BaseCommandInteraction.js +211 -0
  215. package/src/structures/BaseGuild.js +116 -0
  216. package/src/structures/BaseGuildEmoji.js +56 -0
  217. package/src/structures/BaseGuildTextChannel.js +193 -0
  218. package/src/structures/BaseGuildVoiceChannel.js +243 -0
  219. package/src/structures/BaseMessageComponent.js +114 -0
  220. package/src/structures/ButtonInteraction.js +11 -0
  221. package/src/structures/Call.js +58 -0
  222. package/src/structures/CategoryChannel.js +83 -0
  223. package/src/structures/Channel.js +271 -0
  224. package/src/structures/ClientApplication.js +204 -0
  225. package/src/structures/ClientPresence.js +84 -0
  226. package/src/structures/ClientUser.js +624 -0
  227. package/src/structures/CommandInteraction.js +41 -0
  228. package/src/structures/CommandInteractionOptionResolver.js +276 -0
  229. package/src/structures/ContextMenuInteraction.js +65 -0
  230. package/src/structures/DMChannel.js +280 -0
  231. package/src/structures/DeveloperPortalApplication.js +520 -0
  232. package/src/structures/DirectoryChannel.js +20 -0
  233. package/src/structures/Emoji.js +148 -0
  234. package/src/structures/ForumChannel.js +271 -0
  235. package/src/structures/Guild.js +1744 -0
  236. package/src/structures/GuildAuditLogs.js +734 -0
  237. package/src/structures/GuildBan.js +59 -0
  238. package/src/structures/GuildBoost.js +108 -0
  239. package/src/structures/GuildChannel.js +454 -0
  240. package/src/structures/GuildEmoji.js +161 -0
  241. package/src/structures/GuildFolder.js +75 -0
  242. package/src/structures/GuildMember.js +686 -0
  243. package/src/structures/GuildPreview.js +191 -0
  244. package/src/structures/GuildPreviewEmoji.js +27 -0
  245. package/src/structures/GuildScheduledEvent.js +441 -0
  246. package/src/structures/GuildTemplate.js +236 -0
  247. package/src/structures/Integration.js +188 -0
  248. package/src/structures/IntegrationApplication.js +96 -0
  249. package/src/structures/Interaction.js +351 -0
  250. package/src/structures/InteractionCollector.js +248 -0
  251. package/src/structures/InteractionResponse.js +114 -0
  252. package/src/structures/InteractionWebhook.js +43 -0
  253. package/src/structures/Invite.js +375 -0
  254. package/src/structures/InviteGuild.js +23 -0
  255. package/src/structures/InviteStageInstance.js +86 -0
  256. package/src/structures/Message.js +1188 -0
  257. package/src/structures/MessageActionRow.js +103 -0
  258. package/src/structures/MessageAttachment.js +193 -0
  259. package/src/structures/MessageButton.js +231 -0
  260. package/src/structures/MessageCollector.js +146 -0
  261. package/src/structures/MessageComponentInteraction.js +120 -0
  262. package/src/structures/MessageContextMenuInteraction.js +20 -0
  263. package/src/structures/MessageEmbed.js +586 -0
  264. package/src/structures/MessageMentions.js +272 -0
  265. package/src/structures/MessagePayload.js +358 -0
  266. package/src/structures/MessageReaction.js +171 -0
  267. package/src/structures/MessageSelectMenu.js +391 -0
  268. package/src/structures/Modal.js +279 -0
  269. package/src/structures/ModalSubmitFieldsResolver.js +53 -0
  270. package/src/structures/ModalSubmitInteraction.js +119 -0
  271. package/src/structures/NewsChannel.js +32 -0
  272. package/src/structures/OAuth2Guild.js +28 -0
  273. package/src/structures/PartialGroupDMChannel.js +430 -0
  274. package/src/structures/PermissionOverwrites.js +196 -0
  275. package/src/structures/Presence.js +441 -0
  276. package/src/structures/ReactionCollector.js +229 -0
  277. package/src/structures/ReactionEmoji.js +31 -0
  278. package/src/structures/RichPresence.js +722 -0
  279. package/src/structures/Role.js +515 -0
  280. package/src/structures/SelectMenuInteraction.js +170 -0
  281. package/src/structures/Session.js +81 -0
  282. package/src/structures/StageChannel.js +104 -0
  283. package/src/structures/StageInstance.js +208 -0
  284. package/src/structures/Sticker.js +310 -0
  285. package/src/structures/StickerPack.js +95 -0
  286. package/src/structures/StoreChannel.js +56 -0
  287. package/src/structures/Team.js +167 -0
  288. package/src/structures/TeamMember.js +71 -0
  289. package/src/structures/TextChannel.js +33 -0
  290. package/src/structures/TextInputComponent.js +201 -0
  291. package/src/structures/ThreadChannel.js +626 -0
  292. package/src/structures/ThreadMember.js +105 -0
  293. package/src/structures/Typing.js +74 -0
  294. package/src/structures/User.js +697 -0
  295. package/src/structures/UserContextMenuInteraction.js +29 -0
  296. package/src/structures/VoiceChannel.js +110 -0
  297. package/src/structures/VoiceRegion.js +53 -0
  298. package/src/structures/VoiceState.js +306 -0
  299. package/src/structures/WebEmbed.js +401 -0
  300. package/src/structures/Webhook.js +461 -0
  301. package/src/structures/WelcomeChannel.js +60 -0
  302. package/src/structures/WelcomeScreen.js +48 -0
  303. package/src/structures/Widget.js +87 -0
  304. package/src/structures/WidgetMember.js +99 -0
  305. package/src/structures/interfaces/Application.js +190 -0
  306. package/src/structures/interfaces/Collector.js +300 -0
  307. package/src/structures/interfaces/InteractionResponses.js +313 -0
  308. package/src/structures/interfaces/TextBasedChannel.js +566 -0
  309. package/src/util/ActivityFlags.js +44 -0
  310. package/src/util/ApplicationFlags.js +74 -0
  311. package/src/util/BitField.js +170 -0
  312. package/src/util/ChannelFlags.js +45 -0
  313. package/src/util/Constants.js +1917 -0
  314. package/src/util/DataResolver.js +145 -0
  315. package/src/util/Formatters.js +214 -0
  316. package/src/util/GuildMemberFlags.js +43 -0
  317. package/src/util/Intents.js +74 -0
  318. package/src/util/LimitedCollection.js +131 -0
  319. package/src/util/MessageFlags.js +54 -0
  320. package/src/util/Options.js +360 -0
  321. package/src/util/Permissions.js +187 -0
  322. package/src/util/PremiumUsageFlags.js +31 -0
  323. package/src/util/PurchasedFlags.js +31 -0
  324. package/src/util/RemoteAuth.js +522 -0
  325. package/src/util/SnowflakeUtil.js +92 -0
  326. package/src/util/Sweepers.js +466 -0
  327. package/src/util/SystemChannelFlags.js +55 -0
  328. package/src/util/ThreadMemberFlags.js +30 -0
  329. package/src/util/UserFlags.js +104 -0
  330. package/src/util/Util.js +741 -0
  331. package/src/util/Voice.js +1456 -0
  332. package/src/util/arRPC/index.js +229 -0
  333. package/src/util/arRPC/process/detectable.json +1 -0
  334. package/src/util/arRPC/process/index.js +102 -0
  335. package/src/util/arRPC/process/native/index.js +5 -0
  336. package/src/util/arRPC/process/native/linux.js +37 -0
  337. package/src/util/arRPC/process/native/win32.js +25 -0
  338. package/src/util/arRPC/transports/ipc.js +281 -0
  339. package/src/util/arRPC/transports/websocket.js +128 -0
  340. package/typings/enums.d.ts +346 -0
  341. package/typings/index.d.ts +7725 -0
  342. package/typings/index.test-d.ts +0 -0
  343. package/typings/rawDataTypes.d.ts +283 -0
@@ -0,0 +1,1917 @@
1
+ 'use strict';
2
+ /* Not used:
3
+ const process = require('node:process');
4
+ const Package = (exports.Package = require('../../package.json'));
5
+ */
6
+ const { Error, RangeError, TypeError } = require('../errors');
7
+
8
+ exports.defaultUA =
9
+ 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/1.0.9013 Chrome/108.0.5359.215 Electron/22.3.2 Safari/537.36';
10
+
11
+ /**
12
+ * Max bulk deletable message age
13
+ * @typedef {number} MaxBulkDeletableMessageAge
14
+ */
15
+ exports.MaxBulkDeletableMessageAge = 1_209_600_000;
16
+
17
+ /**
18
+ * API captcha solver
19
+ * * `2captcha` - 2captcha.com
20
+ * * `capmonster` - capmonster.cloud
21
+ * @typedef {string[]} captchaServices
22
+ */
23
+ exports.captchaServices = ['2captcha', 'capmonster', 'custom'];
24
+
25
+ /**
26
+ * Automatically scan and delete direct messages you receive that contain explicit media content.
27
+ * * `NOT_SCAN` - Direct messages will not be scanned for explicit content.
28
+ * * `NOT_FRIEND` - Scan direct messages from everyone unless they are a friend.
29
+ * * `EVERYONE` - Scan direct messages from everyone.
30
+ * @typedef {string} DMScanLevel
31
+ */
32
+ exports.DMScanLevel = createEnum(['NOT_SCAN', 'NOT_FRIEND', 'EVERYONE']);
33
+
34
+ /**
35
+ * This controls when stickers animate:
36
+ * * `ALWAYS` - Always animate.
37
+ * * `INTERACTION` - On the desktop client, stickers will animate on hover or focus. On mobile clients, stickers will animate on long-press.
38
+ * * `NEVER` - Never animate.
39
+ * @typedef {string} stickerAnimationMode
40
+ */
41
+ exports.stickerAnimationMode = createEnum(['ALWAYS', 'INTERACTION', 'NEVER']);
42
+
43
+ /**
44
+ * All available nitro types:
45
+ * * `NONE` - None
46
+ * * `NITRO_CLASSIC` - Nitro Classic
47
+ * * `NITRO_BOOST` - Nitro
48
+ * * `NITRO_BASIC` - Nitro Basic
49
+ * * `UNKNOWN` - Unknown
50
+ * @typedef {string} NitroType
51
+ * @see {@link https://discord.com/developers/docs/resources/user#user-object-premium-types}
52
+ */
53
+ exports.NitroType = createEnum(['NONE', 'NITRO_CLASSIC', 'NITRO_BOOST', 'NITRO_BASIC']);
54
+
55
+ /**
56
+ * All available HypeSquad types:
57
+ * * `LEAVE` - None
58
+ * * `HOUSE_BRAVERY` - HypeSquad Bravery
59
+ * * `HOUSE_BRILLIANCE` - HypeSquad Brilliance
60
+ * * `HOUSE_BALANCE` - HypeSquad Balance
61
+ * @typedef {string} HypeSquadType
62
+ */
63
+ exports.HypeSquadType = createEnum(['LEAVE', 'HOUSE_BRAVERY', 'HOUSE_BRILLIANCE', 'HOUSE_BALANCE']);
64
+
65
+ /**
66
+ * All locale codes:
67
+ * * `DANISH`
68
+ * * `GERMAN`
69
+ * * `ENGLISH_UK`
70
+ * * `ENGLISH_US`
71
+ * * `SPANISH`
72
+ * * `FRENCH`
73
+ * * `CROATIAN`
74
+ * * `ITALIAN`
75
+ * * `LITHUANIAN`
76
+ * * `HUNGARIAN`
77
+ * * `DUTCH`
78
+ * * `NORWEGIAN`
79
+ * * `POLISH`
80
+ * * `BRAZILIAN_PORTUGUESE`
81
+ * * `ROMANIA_ROMANIAN`
82
+ * * `FINNISH`
83
+ * * `SWEDISH`
84
+ * * `VIETNAMESE`
85
+ * * `TURKISH`
86
+ * * `CZECH`
87
+ * * `GREEK`
88
+ * * `BULGARIAN`
89
+ * * `RUSSIAN`
90
+ * * `UKRAINIAN`
91
+ * * `HINDI`
92
+ * * `THAI`
93
+ * * `CHINA_CHINESE`
94
+ * * `JAPANESE`
95
+ * * `TAIWAN_CHINESE`
96
+ * * `KOREAN`
97
+ * @typedef {Object<string, string>} localeSetting
98
+ * @see {@link https://discord.com/developers/docs/reference#locales}
99
+ */
100
+ exports.localeSetting = {
101
+ da: 'DANISH',
102
+ de: 'GERMAN',
103
+ 'en-GB': 'ENGLISH_UK',
104
+ 'en-US': 'ENGLISH_US',
105
+ 'es-ES': 'SPANISH',
106
+ fr: 'FRENCH',
107
+ hr: 'CROATIAN',
108
+ it: 'ITALIAN',
109
+ lt: 'LITHUANIAN',
110
+ hu: 'HUNGARIAN',
111
+ nl: 'DUTCH',
112
+ no: 'NORWEGIAN',
113
+ pl: 'POLISH',
114
+ 'pt-BR': 'BRAZILIAN_PORTUGUESE',
115
+ ro: 'ROMANIA_ROMANIAN',
116
+ fi: 'FINNISH',
117
+ 'sv-SE': 'SWEDISH',
118
+ vi: 'VIETNAMESE',
119
+ tr: 'TURKISH',
120
+ cs: 'CZECH',
121
+ el: 'GREEK',
122
+ bg: 'BULGARIAN',
123
+ ru: 'RUSSIAN',
124
+ uk: 'UKRAINIAN',
125
+ hi: 'HINDI',
126
+ th: 'THAI',
127
+ 'zh-CN': 'CHINA_CHINESE',
128
+ ja: 'JAPANESE',
129
+ 'zh-TW': 'TAIWAN_CHINESE',
130
+ ko: 'KOREAN',
131
+ };
132
+
133
+ /**
134
+ * The types of WebSocket error codes:
135
+ * * 1000: WS_CLOSE_REQUESTED
136
+ * * 1011: INTERNAL_ERROR
137
+ * * 4004: TOKEN_INVALID
138
+ * * 4010: SHARDING_INVALID
139
+ * * 4011: SHARDING_REQUIRED
140
+ * * 4013: INVALID_INTENTS
141
+ * * 4014: DISALLOWED_INTENTS
142
+ * @typedef {Object<number, string>} WSCodes
143
+ */
144
+ exports.WSCodes = {
145
+ 1000: 'WS_CLOSE_REQUESTED',
146
+ 1011: 'INTERNAL_ERROR',
147
+ 4004: 'TOKEN_INVALID',
148
+ 4010: 'SHARDING_INVALID',
149
+ 4011: 'SHARDING_REQUIRED',
150
+ 4013: 'INVALID_INTENTS',
151
+ 4014: 'DISALLOWED_INTENTS',
152
+ };
153
+
154
+ const AllowedImageFormats = ['webp', 'png', 'jpg', 'jpeg', 'gif'];
155
+
156
+ const AllowedImageSizes = [16, 32, 56, 64, 96, 128, 256, 300, 512, 600, 1024, 2048, 4096];
157
+
158
+ function makeImageUrl(root, { format = 'webp', size } = {}) {
159
+ if (!['undefined', 'number'].includes(typeof size)) throw new TypeError('INVALID_TYPE', 'size', 'number');
160
+ if (format && !AllowedImageFormats.includes(format)) throw new Error('IMAGE_FORMAT', format);
161
+ if (size && !AllowedImageSizes.includes(size)) throw new RangeError('IMAGE_SIZE', size);
162
+ return `${root}.${format}${size ? `?size=${size}` : ''}`;
163
+ }
164
+
165
+ /**
166
+ * Options for Image URLs.
167
+ * @typedef {StaticImageURLOptions} ImageURLOptions
168
+ * @property {boolean} [dynamic=false] If true, the format will dynamically change to `gif` for animated avatars.
169
+ */
170
+
171
+ /**
172
+ * Options for static Image URLs.
173
+ * @typedef {Object} StaticImageURLOptions
174
+ * @property {string} [format='webp'] One of `webp`, `png`, `jpg`, `jpeg`.
175
+ * @property {number} [size] One of `16`, `32`, `56`, `64`, `96`, `128`, `256`, `300`, `512`, `600`, `1024`, `2048`,
176
+ * `4096`
177
+ */
178
+
179
+ /**
180
+ * An object containing functions that return certain endpoints on the API.
181
+ * @typedef {Object<string, Function|string>} Endpoints
182
+ * @see {@link https://discord.com/developers/docs/reference#image-formatting-cdn-endpoints}
183
+ */
184
+ exports.Endpoints = {
185
+ CDN(root) {
186
+ return {
187
+ Emoji: (emojiId, format = 'webp') => `${root}/emojis/${emojiId}.${format}`,
188
+ Asset: name => `${root}/assets/${name}`,
189
+ DefaultAvatar: discriminator => `${root}/embed/avatars/${discriminator}.png`,
190
+ Avatar: (userId, hash, format, size, dynamic = false) => {
191
+ if (dynamic && hash.startsWith('a_')) format = 'gif';
192
+ return makeImageUrl(`${root}/avatars/${userId}/${hash}`, { format, size });
193
+ },
194
+ AvatarDecoration: (userId, hash, format = 'png', size) =>
195
+ makeImageUrl(`${root}/avatar-decorations/${userId}/${hash}`, { format, size }),
196
+ GuildMemberAvatar: (guildId, memberId, hash, format = 'webp', size, dynamic = false) => {
197
+ if (dynamic && hash.startsWith('a_')) format = 'gif';
198
+ return makeImageUrl(`${root}/guilds/${guildId}/users/${memberId}/avatars/${hash}`, { format, size });
199
+ },
200
+ GuildMemberBanner: (guildId, memberId, hash, format = 'webp', size, dynamic = false) => {
201
+ if (dynamic && hash.startsWith('a_')) format = 'gif';
202
+ return makeImageUrl(`${root}/guilds/${guildId}/users/${memberId}/banners/${hash}`, { format, size });
203
+ },
204
+ Banner: (id, hash, format, size, dynamic = false) => {
205
+ if (dynamic && hash.startsWith('a_')) format = 'gif';
206
+ return makeImageUrl(`${root}/banners/${id}/${hash}`, { format, size });
207
+ },
208
+ Icon: (guildId, hash, format, size, dynamic = false) => {
209
+ if (dynamic && hash.startsWith('a_')) format = 'gif';
210
+ return makeImageUrl(`${root}/icons/${guildId}/${hash}`, { format, size });
211
+ },
212
+ AppIcon: (appId, hash, options) => makeImageUrl(`${root}/app-icons/${appId}/${hash}`, options),
213
+ AppAsset: (appId, hash, options) => makeImageUrl(`${root}/app-assets/${appId}/${hash}`, options),
214
+ StickerPackBanner: (bannerId, format, size) =>
215
+ makeImageUrl(`${root}/app-assets/710982414301790216/store/${bannerId}`, { size, format }),
216
+ GDMIcon: (channelId, hash, format, size) =>
217
+ makeImageUrl(`${root}/channel-icons/${channelId}/${hash}`, { size, format }),
218
+ Splash: (guildId, hash, format, size) => makeImageUrl(`${root}/splashes/${guildId}/${hash}`, { size, format }),
219
+ DiscoverySplash: (guildId, hash, format, size) =>
220
+ makeImageUrl(`${root}/discovery-splashes/${guildId}/${hash}`, { size, format }),
221
+ TeamIcon: (teamId, hash, options) => makeImageUrl(`${root}/team-icons/${teamId}/${hash}`, options),
222
+ Sticker: (stickerId, stickerFormat) =>
223
+ `${root}/stickers/${stickerId}.${
224
+ stickerFormat === 'LOTTIE' ? 'json' : stickerFormat === 'GIF' ? 'gif' : 'png'
225
+ }`,
226
+ RoleIcon: (roleId, hash, format = 'webp', size) =>
227
+ makeImageUrl(`${root}/role-icons/${roleId}/${hash}`, { size, format }),
228
+ guildScheduledEventCover: (scheduledEventId, coverHash, format, size) =>
229
+ makeImageUrl(`${root}/guild-events/${scheduledEventId}/${coverHash}`, { size, format }),
230
+ // Test only
231
+ BadgeIcon: hash => makeImageUrl(`${root}/badge-icons/${hash}`, { format: 'png' }),
232
+ };
233
+ },
234
+ invite: (root, code, eventId) => (eventId ? `${root}/${code}?event=${eventId}` : `${root}/${code}`),
235
+ scheduledEvent: (root, guildId, eventId) => `${root}/${guildId}/${eventId}`,
236
+ botGateway: '/gateway/bot',
237
+ userGateway: '/gateway',
238
+ };
239
+
240
+ /**
241
+ * The current status of the client. Here are the available statuses:
242
+ * * READY: 0
243
+ * * CONNECTING: 1
244
+ * * RECONNECTING: 2
245
+ * * IDLE: 3
246
+ * * NEARLY: 4
247
+ * * DISCONNECTED: 5
248
+ * * WAITING_FOR_GUILDS: 6
249
+ * * IDENTIFYING: 7
250
+ * * RESUMING: 8
251
+ * @typedef {Object<string, number>} Status
252
+ */
253
+ exports.Status = {
254
+ READY: 0,
255
+ CONNECTING: 1,
256
+ RECONNECTING: 2,
257
+ IDLE: 3,
258
+ NEARLY: 4,
259
+ DISCONNECTED: 5,
260
+ WAITING_FOR_GUILDS: 6,
261
+ IDENTIFYING: 7,
262
+ RESUMING: 8,
263
+ };
264
+
265
+ /**
266
+ * The Opcodes sent to the Gateway:
267
+ * * DISPATCH: 0
268
+ * * HEARTBEAT: 1
269
+ * * IDENTIFY: 2
270
+ * * STATUS_UPDATE: 3
271
+ * * VOICE_STATE_UPDATE: 4
272
+ * * VOICE_GUILD_PING: 5
273
+ * * RESUME: 6
274
+ * * RECONNECT: 7
275
+ * * REQUEST_GUILD_MEMBERS: 8
276
+ * * INVALID_SESSION: 9
277
+ * * HELLO: 10
278
+ * * HEARTBEAT_ACK: 11
279
+ * * GUILD_SYNC: 12 [Unused]
280
+ * * DM_UPDATE: 13 # Send => used to get dm features
281
+ * * GUILD_SUBSCRIPTIONS: 14 # Send => discord responds back with GUILD_MEMBER_LIST_UPDATE type SYNC...
282
+ * * LOBBY_CONNECT: 15
283
+ * * LOBBY_DISCONNECT: 16
284
+ * * LOBBY_VOICE_STATE_UPDATE: 17 # Receive
285
+ * * STREAM_CREATE: 18
286
+ * * STREAM_DELETE: 19
287
+ * * STREAM_WATCH: 20
288
+ * * STREAM_PING: 21 # Send
289
+ * * STREAM_SET_PAUSED: 22
290
+ * * REQUEST_APPLICATION_COMMANDS: 24
291
+ * * EMBEDDED_ACTIVITY_LAUNCH: 25
292
+ * * EMBEDDED_ACTIVITY_CLOSE: 26
293
+ * * EMBEDDED_ACTIVITY_UPDATE: 27
294
+ * * REQUEST_FORUM_UNREADS: 28
295
+ * * REMOTE_COMMAND: 29
296
+ * @typedef {Object<string, number>} Opcodes
297
+ */
298
+ exports.Opcodes = {
299
+ DISPATCH: 0, // # Receive => dispatches an event
300
+ HEARTBEAT: 1, // # Send/Receive => used for ping checking
301
+ IDENTIFY: 2, // # Send => used for client handshake
302
+ STATUS_UPDATE: 3, // # Send => used to update the client status
303
+ VOICE_STATE_UPDATE: 4, // # Send => used to join/move/leave voice channels
304
+ VOICE_GUILD_PING: 5, // # Send => used for voice ping checking
305
+ RESUME: 6, // # Send => used to resume a closed connection
306
+ RECONNECT: 7, // # Receive => used to tell when to reconnect (sometimes...)
307
+ REQUEST_GUILD_MEMBERS: 8, // # Send => used to request guild members (when searching for members in the search bar of a guild)
308
+ INVALID_SESSION: 9, // # Receive => used to notify client they have an invalid session id
309
+ HELLO: 10, // # Receive => sent immediately after connecting, contains heartbeat and server debug information
310
+ HEARTBEAT_ACK: 11, // # Sent => immediately following a client heartbeat that was received
311
+ GUILD_SYNC: 12, // # Receive => guild_sync but not used anymore
312
+ DM_UPDATE: 13, // # Send => used to get dm features
313
+ GUILD_SUBSCRIPTIONS: 14, // # Send => discord responds back with GUILD_MEMBER_LIST_UPDATE type SYNC...
314
+ LOBBY_CONNECT: 15,
315
+ LOBBY_DISCONNECT: 16,
316
+ LOBBY_VOICE_STATE_UPDATE: 17, // # Receive
317
+ STREAM_CREATE: 18,
318
+ STREAM_DELETE: 19,
319
+ STREAM_WATCH: 20,
320
+ STREAM_PING: 21, // # Send
321
+ STREAM_SET_PAUSED: 22,
322
+ REQUEST_APPLICATION_COMMANDS: 24, // # Send => request application/bot cmds (user, message, and slash cmds)
323
+ EMBEDDED_ACTIVITY_LAUNCH: 25,
324
+ EMBEDDED_ACTIVITY_CLOSE: 26,
325
+ EMBEDDED_ACTIVITY_UPDATE: 27,
326
+ REQUEST_FORUM_UNREADS: 28,
327
+ REMOTE_COMMAND: 29,
328
+ };
329
+
330
+ /**
331
+ * The types of events emitted by the Client:
332
+ * * RATE_LIMIT: rateLimit
333
+ * * INVALID_REQUEST_WARNING: invalidRequestWarning
334
+ * * API_RESPONSE: apiResponse
335
+ * * API_REQUEST: apiRequest
336
+ * * CLIENT_READY: ready
337
+ * * APPLICATION_COMMAND_AUTOCOMPLETE_RESPONSE: applicationCommandAutocompleteResponse
338
+ * * APPLICATION_COMMAND_CREATE: applicationCommandCreate (deprecated)
339
+ * * APPLICATION_COMMAND_DELETE: applicationCommandDelete (deprecated)
340
+ * * APPLICATION_COMMAND_UPDATE: applicationCommandUpdate (deprecated)
341
+ * * APPLICATION_COMMAND_PERMISSIONS_UPDATE: applicationCommandPermissionsUpdate
342
+ * * AUTO_MODERATION_ACTION_EXECUTION: autoModerationActionExecution
343
+ * * AUTO_MODERATION_RULE_CREATE: autoModerationRuleCreate
344
+ * * AUTO_MODERATION_RULE_DELETE: autoModerationRuleDelete
345
+ * * AUTO_MODERATION_RULE_UPDATE: autoModerationRuleUpdate
346
+ * * CALL_CREATE: callCreate
347
+ * * CALL_DELETE: callDelete
348
+ * * CALL_UPDATE: callUpdate
349
+ * * GUILD_CREATE: guildCreate
350
+ * * GUILD_DELETE: guildDelete
351
+ * * GUILD_UPDATE: guildUpdate
352
+ * * GUILD_UNAVAILABLE: guildUnavailable
353
+ * * GUILD_MEMBER_ADD: guildMemberAdd
354
+ * * GUILD_MEMBER_REMOVE: guildMemberRemove
355
+ * * GUILD_MEMBER_UPDATE: guildMemberUpdate
356
+ * * GUILD_MEMBER_AVAILABLE: guildMemberAvailable
357
+ * * GUILD_MEMBERS_CHUNK: guildMembersChunk
358
+ * * GUILD_INTEGRATIONS_UPDATE: guildIntegrationsUpdate
359
+ * * GUILD_ROLE_CREATE: roleCreate
360
+ * * GUILD_ROLE_DELETE: roleDelete
361
+ * * INVITE_CREATE: inviteCreate
362
+ * * INVITE_DELETE: inviteDelete
363
+ * * GUILD_ROLE_UPDATE: roleUpdate
364
+ * * GUILD_EMOJI_CREATE: emojiCreate
365
+ * * GUILD_EMOJI_DELETE: emojiDelete
366
+ * * GUILD_EMOJI_UPDATE: emojiUpdate
367
+ * * GUILD_BAN_ADD: guildBanAdd
368
+ * * GUILD_BAN_REMOVE: guildBanRemove
369
+ * * CHANNEL_CREATE: channelCreate
370
+ * * CHANNEL_DELETE: channelDelete
371
+ * * CHANNEL_UPDATE: channelUpdate
372
+ * * CHANNEL_PINS_UPDATE: channelPinsUpdate
373
+ * * CHANNEL_RECIPIENT_REMOVE: channelRecipientRemove
374
+ * * CHANNEL_RECIPIENT_ADD: channelRecipientAdd
375
+ * * MESSAGE_ACK: messageAck
376
+ * * MESSAGE_CREATE: messageCreate
377
+ * * MESSAGE_DELETE: messageDelete
378
+ * * MESSAGE_UPDATE: messageUpdate
379
+ * * MESSAGE_BULK_DELETE: messageDeleteBulk
380
+ * * MESSAGE_REACTION_ADD: messageReactionAdd
381
+ * * MESSAGE_REACTION_REMOVE: messageReactionRemove
382
+ * * MESSAGE_REACTION_REMOVE_ALL: messageReactionRemoveAll
383
+ * * MESSAGE_REACTION_REMOVE_EMOJI: messageReactionRemoveEmoji
384
+ * * THREAD_CREATE: threadCreate
385
+ * * THREAD_DELETE: threadDelete
386
+ * * THREAD_UPDATE: threadUpdate
387
+ * * THREAD_LIST_SYNC: threadListSync
388
+ * * THREAD_MEMBER_UPDATE: threadMemberUpdate
389
+ * * THREAD_MEMBERS_UPDATE: threadMembersUpdate
390
+ * * USER_UPDATE: userUpdate
391
+ * * PRESENCE_UPDATE: presenceUpdate
392
+ * * VOICE_SERVER_UPDATE: voiceServerUpdate
393
+ * * VOICE_STATE_UPDATE: voiceStateUpdate
394
+ * * TYPING_START: typingStart
395
+ * * WEBHOOKS_UPDATE: webhookUpdate
396
+ * * INTERACTION_CREATE: interactionCreate
397
+ * * ERROR: error
398
+ * * WARN: warn
399
+ * * DEBUG: debug
400
+ * * CACHE_SWEEP: cacheSweep
401
+ * * SHARD_DISCONNECT: shardDisconnect
402
+ * * SHARD_ERROR: shardError
403
+ * * SHARD_RECONNECTING: shardReconnecting
404
+ * * SHARD_READY: shardReady
405
+ * * SHARD_RESUME: shardResume
406
+ * * INVALIDATED: invalidated
407
+ * * RAW: raw
408
+ * * STAGE_INSTANCE_CREATE: stageInstanceCreate
409
+ * * STAGE_INSTANCE_UPDATE: stageInstanceUpdate
410
+ * * STAGE_INSTANCE_DELETE: stageInstanceDelete
411
+ * * GUILD_STICKER_CREATE: stickerCreate
412
+ * * GUILD_STICKER_DELETE: stickerDelete
413
+ * * GUILD_STICKER_UPDATE: stickerUpdate
414
+ * * GUILD_SCHEDULED_EVENT_CREATE: guildScheduledEventCreate
415
+ * * GUILD_SCHEDULED_EVENT_UPDATE: guildScheduledEventUpdate
416
+ * * GUILD_SCHEDULED_EVENT_DELETE: guildScheduledEventDelete
417
+ * * GUILD_SCHEDULED_EVENT_USER_ADD: guildScheduledEventUserAdd
418
+ * * GUILD_SCHEDULED_EVENT_USER_REMOVE: guildScheduledEventUserRemove
419
+ * * GUILD_AUDIT_LOG_ENTRY_CREATE: guildAuditLogEntryCreate
420
+ * @typedef {Object<string, string>} Events
421
+ */
422
+ exports.Events = {
423
+ RATE_LIMIT: 'rateLimit',
424
+ INVALID_REQUEST_WARNING: 'invalidRequestWarning',
425
+ API_RESPONSE: 'apiResponse',
426
+ API_REQUEST: 'apiRequest',
427
+ CLIENT_READY: 'ready',
428
+ APPLICATION_COMMAND_AUTOCOMPLETE_RESPONSE: 'applicationCommandAutocompleteResponse',
429
+ APPLICATION_COMMAND_CREATE: 'applicationCommandCreate',
430
+ APPLICATION_COMMAND_DELETE: 'applicationCommandDelete',
431
+ APPLICATION_COMMAND_UPDATE: 'applicationCommandUpdate',
432
+ APPLICATION_COMMAND_PERMISSIONS_UPDATE: 'applicationCommandPermissionsUpdate',
433
+ AUTO_MODERATION_ACTION_EXECUTION: 'autoModerationActionExecution',
434
+ AUTO_MODERATION_RULE_CREATE: 'autoModerationRuleCreate',
435
+ AUTO_MODERATION_RULE_DELETE: 'autoModerationRuleDelete',
436
+ AUTO_MODERATION_RULE_UPDATE: 'autoModerationRuleUpdate',
437
+ CALL_CREATE: 'callCreate',
438
+ CALL_DELETE: 'callDelete',
439
+ CALL_UPDATE: 'callUpdate',
440
+ GUILD_CREATE: 'guildCreate',
441
+ GUILD_DELETE: 'guildDelete',
442
+ GUILD_UPDATE: 'guildUpdate',
443
+ GUILD_APPLICATION_COMMANDS_UPDATE: 'guildApplicationCommandUpdate',
444
+ GUILD_UNAVAILABLE: 'guildUnavailable',
445
+ GUILD_MEMBER_ADD: 'guildMemberAdd',
446
+ GUILD_MEMBER_REMOVE: 'guildMemberRemove',
447
+ GUILD_MEMBER_UPDATE: 'guildMemberUpdate',
448
+ GUILD_MEMBER_AVAILABLE: 'guildMemberAvailable',
449
+ GUILD_MEMBERS_CHUNK: 'guildMembersChunk',
450
+ GUILD_MEMBER_LIST_UPDATE: 'guildMemberListUpdate',
451
+ GUILD_INTEGRATIONS_UPDATE: 'guildIntegrationsUpdate',
452
+ GUILD_ROLE_CREATE: 'roleCreate',
453
+ GUILD_ROLE_DELETE: 'roleDelete',
454
+ INVITE_CREATE: 'inviteCreate',
455
+ INVITE_DELETE: 'inviteDelete',
456
+ GUILD_ROLE_UPDATE: 'roleUpdate',
457
+ GUILD_EMOJI_CREATE: 'emojiCreate',
458
+ GUILD_EMOJI_DELETE: 'emojiDelete',
459
+ GUILD_EMOJI_UPDATE: 'emojiUpdate',
460
+ GUILD_BAN_ADD: 'guildBanAdd',
461
+ GUILD_BAN_REMOVE: 'guildBanRemove',
462
+ CHANNEL_CREATE: 'channelCreate',
463
+ CHANNEL_DELETE: 'channelDelete',
464
+ CHANNEL_UPDATE: 'channelUpdate',
465
+ CHANNEL_PINS_UPDATE: 'channelPinsUpdate',
466
+ CHANNEL_RECIPIENT_REMOVE: 'channelRecipientRemove',
467
+ CHANNEL_RECIPIENT_ADD: 'channelRecipientAdd',
468
+ MESSAGE_ACK: 'messageAck',
469
+ MESSAGE_CREATE: 'messageCreate',
470
+ MESSAGE_DELETE: 'messageDelete',
471
+ MESSAGE_UPDATE: 'messageUpdate',
472
+ MESSAGE_BULK_DELETE: 'messageDeleteBulk',
473
+ MESSAGE_REACTION_ADD: 'messageReactionAdd',
474
+ MESSAGE_REACTION_REMOVE: 'messageReactionRemove',
475
+ MESSAGE_REACTION_REMOVE_ALL: 'messageReactionRemoveAll',
476
+ MESSAGE_REACTION_REMOVE_EMOJI: 'messageReactionRemoveEmoji',
477
+ THREAD_CREATE: 'threadCreate',
478
+ THREAD_DELETE: 'threadDelete',
479
+ THREAD_UPDATE: 'threadUpdate',
480
+ THREAD_LIST_SYNC: 'threadListSync',
481
+ THREAD_MEMBER_UPDATE: 'threadMemberUpdate',
482
+ THREAD_MEMBERS_UPDATE: 'threadMembersUpdate',
483
+ USER_UPDATE: 'userUpdate',
484
+ USER_SETTINGS_UPDATE: 'userSettingsUpdate',
485
+ USER_GUILD_SETTINGS_UPDATE: 'userGuildSettingsUpdate',
486
+ PRESENCE_UPDATE: 'presenceUpdate',
487
+ VOICE_SERVER_UPDATE: 'voiceServerUpdate',
488
+ VOICE_STATE_UPDATE: 'voiceStateUpdate',
489
+ TYPING_START: 'typingStart',
490
+ WEBHOOKS_UPDATE: 'webhookUpdate',
491
+ INTERACTION_CREATE: 'interactionCreate',
492
+ INTERACTION_SUCCESS: 'interactionSuccess',
493
+ INTERACTION_FAILURE: 'interactionFailure',
494
+ INTERACTION_MODAL_CREATE: 'interactionModalCreate',
495
+ ERROR: 'error',
496
+ WARN: 'warn',
497
+ DEBUG: 'debug',
498
+ CACHE_SWEEP: 'cacheSweep',
499
+ SHARD_DISCONNECT: 'shardDisconnect',
500
+ SHARD_ERROR: 'shardError',
501
+ SHARD_RECONNECTING: 'shardReconnecting',
502
+ SHARD_READY: 'shardReady',
503
+ SHARD_RESUME: 'shardResume',
504
+ INVALIDATED: 'invalidated',
505
+ RAW: 'raw',
506
+ STAGE_INSTANCE_CREATE: 'stageInstanceCreate',
507
+ STAGE_INSTANCE_UPDATE: 'stageInstanceUpdate',
508
+ STAGE_INSTANCE_DELETE: 'stageInstanceDelete',
509
+ GUILD_STICKER_CREATE: 'stickerCreate',
510
+ GUILD_STICKER_DELETE: 'stickerDelete',
511
+ GUILD_STICKER_UPDATE: 'stickerUpdate',
512
+ GUILD_SCHEDULED_EVENT_CREATE: 'guildScheduledEventCreate',
513
+ GUILD_SCHEDULED_EVENT_UPDATE: 'guildScheduledEventUpdate',
514
+ GUILD_SCHEDULED_EVENT_DELETE: 'guildScheduledEventDelete',
515
+ GUILD_SCHEDULED_EVENT_USER_ADD: 'guildScheduledEventUserAdd',
516
+ GUILD_SCHEDULED_EVENT_USER_REMOVE: 'guildScheduledEventUserRemove',
517
+ GUILD_AUDIT_LOG_ENTRY_CREATE: 'guildAuditLogEntryCreate',
518
+ RELATIONSHIP_ADD: 'relationshipAdd',
519
+ RELATIONSHIP_REMOVE: 'relationshipRemove',
520
+ RELATIONSHIP_UPDATE: 'relationshipUpdate',
521
+ UNHANDLED_PACKET: 'unhandledPacket',
522
+ CAPTCHA_REQUIRED: 'captchaRequired',
523
+ };
524
+
525
+ /**
526
+ * The types of events emitted by a Shard:
527
+ * * CLOSE: close
528
+ * * DESTROYED: destroyed
529
+ * * INVALID_SESSION: invalidSession
530
+ * * READY: ready
531
+ * * RESUMED: resumed
532
+ * * ALL_READY: allReady
533
+ * @typedef {Object<string, string>} ShardEvents
534
+ */
535
+ exports.ShardEvents = {
536
+ CLOSE: 'close',
537
+ DESTROYED: 'destroyed',
538
+ INVALID_SESSION: 'invalidSession',
539
+ READY: 'ready',
540
+ RESUMED: 'resumed',
541
+ ALL_READY: 'allReady',
542
+ };
543
+
544
+ /**
545
+ * The type of Structure allowed to be a partial:
546
+ * * USER
547
+ * * CHANNEL (only affects DMChannels)
548
+ * * GUILD_MEMBER
549
+ * * MESSAGE
550
+ * * REACTION
551
+ * * GUILD_SCHEDULED_EVENT
552
+ * <warn>Partials require you to put checks in place when handling data. See the "Partial Structures" topic on the
553
+ * [guide](https://discordjs.guide/popular-topics/partials.html) for more information.</warn>
554
+ * @typedef {string} PartialType
555
+ */
556
+ exports.PartialTypes = keyMirror(['USER', 'CHANNEL', 'GUILD_MEMBER', 'MESSAGE', 'REACTION', 'GUILD_SCHEDULED_EVENT']);
557
+
558
+ /**
559
+ * The type of a WebSocket message event, e.g. `MESSAGE_CREATE`. Here are the available events:
560
+ * * READY
561
+ * * RESUMED
562
+ * * APPLICATION_COMMAND_AUTOCOMPLETE_RESPONSE
563
+ * * APPLICATION_COMMAND_CREATE (deprecated)
564
+ * * APPLICATION_COMMAND_DELETE (deprecated)
565
+ * * APPLICATION_COMMAND_UPDATE (deprecated)
566
+ * * APPLICATION_COMMAND_PERMISSIONS_UPDATE
567
+ * * AUTO_MODERATION_ACTION_EXECUTION
568
+ * * AUTO_MODERATION_RULE_CREATE
569
+ * * AUTO_MODERATION_RULE_DELETE
570
+ * * AUTO_MODERATION_RULE_UPDATE
571
+ * * GUILD_CREATE
572
+ * * GUILD_DELETE
573
+ * * GUILD_UPDATE
574
+ * * INVITE_CREATE
575
+ * * INVITE_DELETE
576
+ * * GUILD_MEMBER_ADD
577
+ * * GUILD_MEMBER_REMOVE
578
+ * * GUILD_MEMBER_UPDATE
579
+ * * GUILD_MEMBERS_CHUNK
580
+ * * GUILD_INTEGRATIONS_UPDATE
581
+ * * GUILD_ROLE_CREATE
582
+ * * GUILD_ROLE_DELETE
583
+ * * GUILD_ROLE_UPDATE
584
+ * * GUILD_BAN_ADD
585
+ * * GUILD_BAN_REMOVE
586
+ * * GUILD_EMOJIS_UPDATE
587
+ * * CHANNEL_CREATE
588
+ * * CHANNEL_DELETE
589
+ * * CHANNEL_UPDATE
590
+ * * CHANNEL_PINS_UPDATE
591
+ * * MESSAGE_CREATE
592
+ * * MESSAGE_DELETE
593
+ * * MESSAGE_UPDATE
594
+ * * MESSAGE_DELETE_BULK
595
+ * * MESSAGE_REACTION_ADD
596
+ * * MESSAGE_REACTION_REMOVE
597
+ * * MESSAGE_REACTION_REMOVE_ALL
598
+ * * MESSAGE_REACTION_REMOVE_EMOJI
599
+ * * THREAD_CREATE
600
+ * * THREAD_UPDATE
601
+ * * THREAD_DELETE
602
+ * * THREAD_LIST_SYNC
603
+ * * THREAD_MEMBER_UPDATE
604
+ * * THREAD_MEMBERS_UPDATE
605
+ * * USER_UPDATE
606
+ * * PRESENCE_UPDATE
607
+ * * TYPING_START
608
+ * * VOICE_STATE_UPDATE
609
+ * * VOICE_SERVER_UPDATE
610
+ * * WEBHOOKS_UPDATE
611
+ * * INTERACTION_CREATE
612
+ * * STAGE_INSTANCE_CREATE
613
+ * * STAGE_INSTANCE_UPDATE
614
+ * * STAGE_INSTANCE_DELETE
615
+ * * GUILD_STICKERS_UPDATE
616
+ * * GUILD_SCHEDULED_EVENT_CREATE
617
+ * * GUILD_SCHEDULED_EVENT_UPDATE
618
+ * * GUILD_SCHEDULED_EVENT_DELETE
619
+ * * GUILD_SCHEDULED_EVENT_USER_ADD
620
+ * * GUILD_SCHEDULED_EVENT_USER_REMOVE
621
+ * * GUILD_AUDIT_LOG_ENTRY_CREATE
622
+ * @typedef {string} WSEventType
623
+ * @see {@link https://discord.com/developers/docs/topics/gateway-events#receive-events}
624
+ */
625
+ exports.WSEvents = keyMirror([
626
+ 'READY',
627
+ 'RESUMED',
628
+ 'APPLICATION_COMMAND_AUTOCOMPLETE_RESPONSE',
629
+ 'APPLICATION_COMMAND_CREATE',
630
+ 'APPLICATION_COMMAND_DELETE',
631
+ 'APPLICATION_COMMAND_UPDATE',
632
+ 'APPLICATION_COMMAND_PERMISSIONS_UPDATE',
633
+ 'AUTO_MODERATION_ACTION_EXECUTION',
634
+ 'AUTO_MODERATION_RULE_CREATE',
635
+ 'AUTO_MODERATION_RULE_DELETE',
636
+ 'AUTO_MODERATION_RULE_UPDATE',
637
+ 'GUILD_CREATE',
638
+ 'GUILD_DELETE',
639
+ 'GUILD_UPDATE',
640
+ 'INVITE_CREATE',
641
+ 'INVITE_DELETE',
642
+ 'GUILD_MEMBER_ADD',
643
+ 'GUILD_MEMBER_REMOVE',
644
+ 'GUILD_MEMBER_UPDATE',
645
+ 'GUILD_MEMBERS_CHUNK',
646
+ 'GUILD_INTEGRATIONS_UPDATE',
647
+ 'GUILD_ROLE_CREATE',
648
+ 'GUILD_ROLE_DELETE',
649
+ 'GUILD_ROLE_UPDATE',
650
+ 'GUILD_BAN_ADD',
651
+ 'GUILD_BAN_REMOVE',
652
+ 'GUILD_EMOJIS_UPDATE',
653
+ 'CHANNEL_CREATE',
654
+ 'CHANNEL_DELETE',
655
+ 'CHANNEL_UPDATE',
656
+ 'CHANNEL_PINS_UPDATE',
657
+ 'MESSAGE_CREATE',
658
+ 'MESSAGE_DELETE',
659
+ 'MESSAGE_UPDATE',
660
+ 'MESSAGE_DELETE_BULK',
661
+ 'MESSAGE_REACTION_ADD',
662
+ 'MESSAGE_REACTION_REMOVE',
663
+ 'MESSAGE_REACTION_REMOVE_ALL',
664
+ 'MESSAGE_REACTION_REMOVE_EMOJI',
665
+ 'THREAD_CREATE',
666
+ 'THREAD_UPDATE',
667
+ 'THREAD_DELETE',
668
+ 'THREAD_LIST_SYNC',
669
+ 'THREAD_MEMBER_UPDATE',
670
+ 'THREAD_MEMBERS_UPDATE',
671
+ 'USER_UPDATE',
672
+ 'PRESENCE_UPDATE',
673
+ 'TYPING_START',
674
+ 'VOICE_STATE_UPDATE',
675
+ 'VOICE_SERVER_UPDATE',
676
+ 'WEBHOOKS_UPDATE',
677
+ 'INTERACTION_CREATE',
678
+ 'STAGE_INSTANCE_CREATE',
679
+ 'STAGE_INSTANCE_UPDATE',
680
+ 'STAGE_INSTANCE_DELETE',
681
+ 'GUILD_STICKERS_UPDATE',
682
+ 'GUILD_SCHEDULED_EVENT_CREATE',
683
+ 'GUILD_SCHEDULED_EVENT_UPDATE',
684
+ 'GUILD_SCHEDULED_EVENT_DELETE',
685
+ 'GUILD_SCHEDULED_EVENT_USER_ADD',
686
+ 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
687
+ 'GUILD_AUDIT_LOG_ENTRY_CREATE',
688
+ ]);
689
+
690
+ /**
691
+ * A valid scope to request when generating an invite link.
692
+ * <warn>Scopes that require whitelist are not considered valid for this generator</warn>
693
+ * * `applications.builds.read`: allows reading build data for a users applications
694
+ * * `applications.commands`: allows this bot to create commands in the server
695
+ * * `applications.entitlements`: allows reading entitlements for a users applications
696
+ * * `applications.store.update`: allows reading and updating of store data for a users applications
697
+ * * `bot`: makes the bot join the selected guild
698
+ * * `connections`: makes the endpoint for getting a users connections available
699
+ * * `email`: allows the `/users/@me` endpoint return with an email
700
+ * * `identify`: allows the `/users/@me` endpoint without an email
701
+ * * `guilds`: makes the `/users/@me/guilds` endpoint available for a user
702
+ * * `guilds.join`: allows the bot to join the user to any guild it is in using Guild#addMember
703
+ * * `gdm.join`: allows joining the user to a group dm
704
+ * * `webhook.incoming`: generates a webhook to a channel
705
+ * @typedef {string} InviteScope
706
+ * @see {@link https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes}
707
+ */
708
+ exports.InviteScopes = [
709
+ 'applications.builds.read',
710
+ 'applications.commands',
711
+ 'applications.entitlements',
712
+ 'applications.store.update',
713
+ 'bot',
714
+ 'connections',
715
+ 'email',
716
+ 'identify',
717
+ 'guilds',
718
+ 'guilds.join',
719
+ 'gdm.join',
720
+ 'webhook.incoming',
721
+ ];
722
+
723
+ // TODO: change Integration#expireBehavior to this and clean up Integration
724
+ /**
725
+ * The behavior of expiring subscribers for Integrations. This can be:
726
+ * * REMOVE_ROLE
727
+ * * KICK
728
+ * @typedef {string} IntegrationExpireBehavior
729
+ * @see {@link https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors}
730
+ */
731
+ exports.IntegrationExpireBehaviors = createEnum(['REMOVE_ROLE', 'KICK']);
732
+
733
+ /**
734
+ * The type of a message, e.g. `DEFAULT`. Here are the available types:
735
+ * * DEFAULT
736
+ * * RECIPIENT_ADD
737
+ * * RECIPIENT_REMOVE
738
+ * * CALL
739
+ * * CHANNEL_NAME_CHANGE
740
+ * * CHANNEL_ICON_CHANGE
741
+ * * CHANNEL_PINNED_MESSAGE
742
+ * * GUILD_MEMBER_JOIN
743
+ * * USER_PREMIUM_GUILD_SUBSCRIPTION
744
+ * * USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1
745
+ * * USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2
746
+ * * USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3
747
+ * * CHANNEL_FOLLOW_ADD
748
+ * * GUILD_DISCOVERY_DISQUALIFIED
749
+ * * GUILD_DISCOVERY_REQUALIFIED
750
+ * * GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING
751
+ * * GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING
752
+ * * THREAD_CREATED
753
+ * * REPLY
754
+ * * APPLICATION_COMMAND
755
+ * * THREAD_STARTER_MESSAGE
756
+ * * GUILD_INVITE_REMINDER
757
+ * * CONTEXT_MENU_COMMAND
758
+ * * AUTO_MODERATION_ACTION
759
+ * * ROLE_SUBSCRIPTION_PURCHASE
760
+ * @typedef {string} MessageType
761
+ * @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-types}
762
+ */
763
+ exports.MessageTypes = [
764
+ 'DEFAULT',
765
+ 'RECIPIENT_ADD',
766
+ 'RECIPIENT_REMOVE',
767
+ 'CALL',
768
+ 'CHANNEL_NAME_CHANGE',
769
+ 'CHANNEL_ICON_CHANGE',
770
+ 'CHANNEL_PINNED_MESSAGE',
771
+ 'GUILD_MEMBER_JOIN',
772
+ 'USER_PREMIUM_GUILD_SUBSCRIPTION',
773
+ 'USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1',
774
+ 'USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2',
775
+ 'USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3',
776
+ 'CHANNEL_FOLLOW_ADD',
777
+ null,
778
+ 'GUILD_DISCOVERY_DISQUALIFIED',
779
+ 'GUILD_DISCOVERY_REQUALIFIED',
780
+ 'GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING',
781
+ 'GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING',
782
+ 'THREAD_CREATED',
783
+ 'REPLY',
784
+ 'APPLICATION_COMMAND',
785
+ 'THREAD_STARTER_MESSAGE',
786
+ 'GUILD_INVITE_REMINDER',
787
+ 'CONTEXT_MENU_COMMAND',
788
+ 'AUTO_MODERATION_ACTION',
789
+ 'ROLE_SUBSCRIPTION_PURCHASE',
790
+ ];
791
+
792
+ /**
793
+ * The name of an item to be swept in Sweepers
794
+ * * `applicationCommands` - both global and guild commands
795
+ * * `autoModerationRules`
796
+ * * `bans`
797
+ * * `emojis`
798
+ * * `invites` - accepts the `lifetime` property, using it will sweep based on expires timestamp
799
+ * * `guildMembers`
800
+ * * `messages` - accepts the `lifetime` property, using it will sweep based on edited or created timestamp
801
+ * * `presences`
802
+ * * `reactions`
803
+ * * `stageInstances`
804
+ * * `stickers`
805
+ * * `threadMembers`
806
+ * * `threads` - accepts the `lifetime` property, using it will sweep archived threads based on archived timestamp
807
+ * * `users`
808
+ * * `voiceStates`
809
+ * @typedef {string} SweeperKey
810
+ */
811
+ exports.SweeperKeys = [
812
+ 'applicationCommands',
813
+ 'autoModerationRules',
814
+ 'bans',
815
+ 'emojis',
816
+ 'invites',
817
+ 'guildMembers',
818
+ 'messages',
819
+ 'presences',
820
+ 'reactions',
821
+ 'stageInstances',
822
+ 'stickers',
823
+ 'threadMembers',
824
+ 'threads',
825
+ 'users',
826
+ 'voiceStates',
827
+ ];
828
+
829
+ /**
830
+ * The types of messages that are `System`. The available types are `MessageTypes` excluding:
831
+ * * DEFAULT
832
+ * * REPLY
833
+ * * APPLICATION_COMMAND
834
+ * * CONTEXT_MENU_COMMAND
835
+ * @typedef {string} SystemMessageType
836
+ */
837
+ exports.SystemMessageTypes = exports.MessageTypes.filter(
838
+ type => type && !['DEFAULT', 'REPLY', 'APPLICATION_COMMAND', 'CONTEXT_MENU_COMMAND'].includes(type),
839
+ );
840
+
841
+ /**
842
+ * <info>Bots cannot set a `CUSTOM` activity type, it is only for custom statuses received from users</info>
843
+ * The type of an activity of a user's presence. Here are the available types:
844
+ * * PLAYING
845
+ * * STREAMING
846
+ * * LISTENING
847
+ * * WATCHING
848
+ * * CUSTOM
849
+ * * COMPETING
850
+ * @typedef {string} ActivityType
851
+ * @see {@link https://discord.com/developers/docs/game-sdk/activities#data-models-activitytype-enum}
852
+ */
853
+ exports.ActivityTypes = createEnum(['PLAYING', 'STREAMING', 'LISTENING', 'WATCHING', 'CUSTOM', 'COMPETING']);
854
+
855
+ /**
856
+ * All available channel types:
857
+ * * `GUILD_TEXT` - a guild text channel
858
+ * * `DM` - a DM channel
859
+ * * `GUILD_VOICE` - a guild voice channel
860
+ * * `GROUP_DM` - a group DM channel
861
+ * * `GUILD_CATEGORY` - a guild category channel
862
+ * * `GUILD_NEWS` - a guild news channel
863
+ * * `GUILD_STORE` - a guild store channel
864
+ * <warn>Store channels are deprecated and will be removed from Discord in March 2022. See
865
+ * [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/6309018858647)
866
+ * for more information.</warn>
867
+ * * `GUILD_NEWS_THREAD` - a guild news channel's public thread channel
868
+ * * `GUILD_PUBLIC_THREAD` - a guild text channel's public thread channel
869
+ * * `GUILD_PRIVATE_THREAD` - a guild text channel's private thread channel
870
+ * * `GUILD_STAGE_VOICE` - a guild stage voice channel
871
+ * * `GUILD_DIRECTORY` - the channel in a hub containing guilds
872
+ * * `GUILD_FORUM` - a guild channel that only contains threads
873
+ * * `UNKNOWN` - a generic channel of unknown type, could be Channel or GuildChannel
874
+ * @typedef {string} ChannelType
875
+ * @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-types}
876
+ */
877
+ exports.ChannelTypes = createEnum([
878
+ 'GUILD_TEXT',
879
+ 'DM',
880
+ 'GUILD_VOICE',
881
+ 'GROUP_DM',
882
+ 'GUILD_CATEGORY',
883
+ 'GUILD_NEWS',
884
+ 'GUILD_STORE',
885
+ ...Array(3).fill(null),
886
+ // 10
887
+ 'GUILD_NEWS_THREAD',
888
+ 'GUILD_PUBLIC_THREAD',
889
+ 'GUILD_PRIVATE_THREAD',
890
+ 'GUILD_STAGE_VOICE',
891
+ 'GUILD_DIRECTORY',
892
+ 'GUILD_FORUM',
893
+ ]);
894
+
895
+ /**
896
+ * The channels that are text-based.
897
+ * * DMChannel
898
+ * * TextChannel
899
+ * * NewsChannel
900
+ * * ThreadChannel
901
+ * * VoiceChannel
902
+ * * StageChannel
903
+ * @typedef {DMChannel|TextChannel|NewsChannel|ThreadChannel|VoiceChannel|StageChannel} TextBasedChannels
904
+ */
905
+
906
+ /**
907
+ * Data that resolves to give a text-based channel. This can be:
908
+ * * A text-based channel
909
+ * * A snowflake
910
+ * @typedef {TextBasedChannels|Snowflake} TextBasedChannelsResolvable
911
+ */
912
+
913
+ /**
914
+ * The types of channels that are text-based. The available types are:
915
+ * * DM
916
+ * * GUILD_TEXT
917
+ * * GUILD_NEWS
918
+ * * GUILD_NEWS_THREAD
919
+ * * GUILD_PUBLIC_THREAD
920
+ * * GUILD_PRIVATE_THREAD
921
+ * * GUILD_VOICE
922
+ * * GUILD_STAGE_VOICE
923
+ * @typedef {string} TextBasedChannelTypes
924
+ */
925
+ exports.TextBasedChannelTypes = [
926
+ 'DM',
927
+ 'GUILD_TEXT',
928
+ 'GUILD_NEWS',
929
+ 'GUILD_NEWS_THREAD',
930
+ 'GUILD_PUBLIC_THREAD',
931
+ 'GUILD_PRIVATE_THREAD',
932
+ 'GUILD_VOICE',
933
+ 'GUILD_STAGE_VOICE',
934
+ ];
935
+
936
+ /**
937
+ * The types of channels that are threads. The available types are:
938
+ * * GUILD_NEWS_THREAD
939
+ * * GUILD_PUBLIC_THREAD
940
+ * * GUILD_PRIVATE_THREAD
941
+ * @typedef {string} ThreadChannelTypes
942
+ */
943
+ exports.ThreadChannelTypes = ['GUILD_NEWS_THREAD', 'GUILD_PUBLIC_THREAD', 'GUILD_PRIVATE_THREAD'];
944
+
945
+ /**
946
+ * The types of channels that are voice-based. The available types are:
947
+ * * GUILD_VOICE
948
+ * * GUILD_STAGE_VOICE
949
+ * @typedef {string} VoiceBasedChannelTypes
950
+ */
951
+ exports.VoiceBasedChannelTypes = ['GUILD_VOICE', 'GUILD_STAGE_VOICE'];
952
+
953
+ /**
954
+ * The types of assets of an application:
955
+ * * SMALL: 1
956
+ * * BIG: 2
957
+ * @typedef {Object<string, number>} ClientApplicationAssetTypes
958
+ */
959
+ exports.ClientApplicationAssetTypes = {
960
+ SMALL: 1,
961
+ BIG: 2,
962
+ };
963
+
964
+ /**
965
+ * A commonly used color:
966
+ * * DEFAULT
967
+ * * WHITE
968
+ * * AQUA
969
+ * * GREEN
970
+ * * BLUE
971
+ * * YELLOW
972
+ * * PURPLE
973
+ * * LUMINOUS_VIVID_PINK
974
+ * * FUCHSIA
975
+ * * GOLD
976
+ * * ORANGE
977
+ * * RED
978
+ * * GREY
979
+ * * NAVY
980
+ * * DARK_AQUA
981
+ * * DARK_GREEN
982
+ * * DARK_BLUE
983
+ * * DARK_PURPLE
984
+ * * DARK_VIVID_PINK
985
+ * * DARK_GOLD
986
+ * * DARK_ORANGE
987
+ * * DARK_RED
988
+ * * DARK_GREY
989
+ * * DARKER_GREY
990
+ * * LIGHT_GREY
991
+ * * DARK_NAVY
992
+ * * BLURPLE
993
+ * * GREYPLE
994
+ * * DARK_BUT_NOT_BLACK
995
+ * * NOT_QUITE_BLACK
996
+ * @typedef {string} Color
997
+ */
998
+ exports.Colors = {
999
+ DEFAULT: 0x000000,
1000
+ WHITE: 0xffffff,
1001
+ AQUA: 0x1abc9c,
1002
+ GREEN: 0x57f287,
1003
+ BLUE: 0x3498db,
1004
+ YELLOW: 0xfee75c,
1005
+ PURPLE: 0x9b59b6,
1006
+ LUMINOUS_VIVID_PINK: 0xe91e63,
1007
+ FUCHSIA: 0xeb459e,
1008
+ GOLD: 0xf1c40f,
1009
+ ORANGE: 0xe67e22,
1010
+ RED: 0xed4245,
1011
+ GREY: 0x95a5a6,
1012
+ NAVY: 0x34495e,
1013
+ DARK_AQUA: 0x11806a,
1014
+ DARK_GREEN: 0x1f8b4c,
1015
+ DARK_BLUE: 0x206694,
1016
+ DARK_PURPLE: 0x71368a,
1017
+ DARK_VIVID_PINK: 0xad1457,
1018
+ DARK_GOLD: 0xc27c0e,
1019
+ DARK_ORANGE: 0xa84300,
1020
+ DARK_RED: 0x992d22,
1021
+ DARK_GREY: 0x979c9f,
1022
+ DARKER_GREY: 0x7f8c8d,
1023
+ LIGHT_GREY: 0xbcc0c0,
1024
+ DARK_NAVY: 0x2c3e50,
1025
+ BLURPLE: 0x5865f2,
1026
+ GREYPLE: 0x99aab5,
1027
+ DARK_BUT_NOT_BLACK: 0x2c2f33,
1028
+ NOT_QUITE_BLACK: 0x23272a,
1029
+ };
1030
+
1031
+ /**
1032
+ * The value set for the explicit content filter levels for a guild:
1033
+ * * DISABLED
1034
+ * * MEMBERS_WITHOUT_ROLES
1035
+ * * ALL_MEMBERS
1036
+ * @typedef {string} ExplicitContentFilterLevel
1037
+ * @see {@link https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level}
1038
+ */
1039
+ exports.ExplicitContentFilterLevels = createEnum(['DISABLED', 'MEMBERS_WITHOUT_ROLES', 'ALL_MEMBERS']);
1040
+
1041
+ /**
1042
+ * The value set for the verification levels for a guild:
1043
+ * * NONE
1044
+ * * LOW
1045
+ * * MEDIUM
1046
+ * * HIGH
1047
+ * * VERY_HIGH
1048
+ * @typedef {string} VerificationLevel
1049
+ * @see {@link https://discord.com/developers/docs/resources/guild#guild-object-verification-level}
1050
+ */
1051
+ exports.VerificationLevels = createEnum(['NONE', 'LOW', 'MEDIUM', 'HIGH', 'VERY_HIGH']);
1052
+
1053
+ /**
1054
+ * An error encountered while performing an API request. Here are the potential errors:
1055
+ * * UNKNOWN_ACCOUNT
1056
+ * * UNKNOWN_APPLICATION
1057
+ * * UNKNOWN_CHANNEL
1058
+ * * UNKNOWN_GUILD
1059
+ * * UNKNOWN_INTEGRATION
1060
+ * * UNKNOWN_INVITE
1061
+ * * UNKNOWN_MEMBER
1062
+ * * UNKNOWN_MESSAGE
1063
+ * * UNKNOWN_OVERWRITE
1064
+ * * UNKNOWN_PROVIDER
1065
+ * * UNKNOWN_ROLE
1066
+ * * UNKNOWN_TOKEN
1067
+ * * UNKNOWN_USER
1068
+ * * UNKNOWN_EMOJI
1069
+ * * UNKNOWN_WEBHOOK
1070
+ * * UNKNOWN_WEBHOOK_SERVICE
1071
+ * * UNKNOWN_SESSION
1072
+ * * UNKNOWN_BAN
1073
+ * * UNKNOWN_SKU
1074
+ * * UNKNOWN_STORE_LISTING
1075
+ * * UNKNOWN_ENTITLEMENT
1076
+ * * UNKNOWN_BUILD
1077
+ * * UNKNOWN_LOBBY
1078
+ * * UNKNOWN_BRANCH
1079
+ * * UNKNOWN_STORE_DIRECTORY_LAYOUT
1080
+ * * UNKNOWN_REDISTRIBUTABLE
1081
+ * * UNKNOWN_GIFT_CODE
1082
+ * * UNKNOWN_STREAM
1083
+ * * UNKNOWN_PREMIUM_SERVER_SUBSCRIBE_COOLDOWN
1084
+ * * UNKNOWN_GUILD_TEMPLATE
1085
+ * * UNKNOWN_DISCOVERABLE_SERVER_CATEGORY
1086
+ * * UNKNOWN_STICKER
1087
+ * * UNKNOWN_INTERACTION
1088
+ * * UNKNOWN_APPLICATION_COMMAND
1089
+ * * UNKNOWN_APPLICATION_COMMAND_PERMISSIONS
1090
+ * * UNKNOWN_STAGE_INSTANCE
1091
+ * * UNKNOWN_GUILD_MEMBER_VERIFICATION_FORM
1092
+ * * UNKNOWN_GUILD_WELCOME_SCREEN
1093
+ * * UNKNOWN_GUILD_SCHEDULED_EVENT
1094
+ * * UNKNOWN_GUILD_SCHEDULED_EVENT_USER
1095
+ * * BOT_PROHIBITED_ENDPOINT
1096
+ * * BOT_ONLY_ENDPOINT
1097
+ * * CANNOT_SEND_EXPLICIT_CONTENT
1098
+ * * NOT_AUTHORIZED
1099
+ * * SLOWMODE_RATE_LIMIT
1100
+ * * ACCOUNT_OWNER_ONLY
1101
+ * * ANNOUNCEMENT_EDIT_LIMIT_EXCEEDED
1102
+ * * CHANNEL_HIT_WRITE_RATELIMIT
1103
+ * * SERVER_HIT_WRITE_RATELIMIT
1104
+ * * CONTENT_NOT_ALLOWED
1105
+ * * GUILD_PREMIUM_LEVEL_TOO_LOW
1106
+ * * MAXIMUM_GUILDS
1107
+ * * MAXIMUM_FRIENDS
1108
+ * * MAXIMUM_PINS
1109
+ * * MAXIMUM_RECIPIENTS
1110
+ * * MAXIMUM_ROLES
1111
+ * * MAXIMUM_USERNAMES
1112
+ * * MAXIMUM_WEBHOOKS
1113
+ * * MAXIMUM_EMOJIS
1114
+ * * MAXIMUM_REACTIONS
1115
+ * * MAXIMUM_CHANNELS
1116
+ * * MAXIMUM_ATTACHMENTS
1117
+ * * MAXIMUM_INVITES
1118
+ * * MAXIMUM_ANIMATED_EMOJIS
1119
+ * * MAXIMUM_SERVER_MEMBERS
1120
+ * * MAXIMUM_NUMBER_OF_SERVER_CATEGORIES
1121
+ * * GUILD_ALREADY_HAS_TEMPLATE
1122
+ * * MAXIMUM_THREAD_PARTICIPANTS
1123
+ * * MAXIMUM_NON_GUILD_MEMBERS_BANS
1124
+ * * MAXIMUM_BAN_FETCHES
1125
+ * * MAXIMUM_NUMBER_OF_UNCOMPLETED_GUILD_SCHEDULED_EVENTS_REACHED
1126
+ * * MAXIMUM_NUMBER_OF_STICKERS_REACHED
1127
+ * * MAXIMUM_PRUNE_REQUESTS
1128
+ * * MAXIMUM_GUILD_WIDGET_SETTINGS_UPDATE
1129
+ * * UNAUTHORIZED
1130
+ * * ACCOUNT_VERIFICATION_REQUIRED
1131
+ * * DIRECT_MESSAGES_TOO_FAST
1132
+ * * REQUEST_ENTITY_TOO_LARGE
1133
+ * * FEATURE_TEMPORARILY_DISABLED
1134
+ * * USER_BANNED
1135
+ * * TARGET_USER_NOT_CONNECTED_TO_VOICE
1136
+ * * ALREADY_CROSSPOSTED
1137
+ * * MISSING_ACCESS
1138
+ * * INVALID_ACCOUNT_TYPE
1139
+ * * CANNOT_EXECUTE_ON_DM
1140
+ * * EMBED_DISABLED
1141
+ * * CANNOT_EDIT_MESSAGE_BY_OTHER
1142
+ * * CANNOT_SEND_EMPTY_MESSAGE
1143
+ * * CANNOT_MESSAGE_USER
1144
+ * * CANNOT_SEND_MESSAGES_IN_VOICE_CHANNEL
1145
+ * * CHANNEL_VERIFICATION_LEVEL_TOO_HIGH
1146
+ * * OAUTH2_APPLICATION_BOT_ABSENT
1147
+ * * MAXIMUM_OAUTH2_APPLICATIONS
1148
+ * * INVALID_OAUTH_STATE
1149
+ * * MISSING_PERMISSIONS
1150
+ * * INVALID_AUTHENTICATION_TOKEN
1151
+ * * NOTE_TOO_LONG
1152
+ * * INVALID_BULK_DELETE_QUANTITY
1153
+ * * CANNOT_PIN_MESSAGE_IN_OTHER_CHANNEL
1154
+ * * INVALID_OR_TAKEN_INVITE_CODE
1155
+ * * CANNOT_EXECUTE_ON_SYSTEM_MESSAGE
1156
+ * * CANNOT_EXECUTE_ON_CHANNEL_TYPE
1157
+ * * INVALID_OAUTH_TOKEN
1158
+ * * MISSING_OAUTH_SCOPE
1159
+ * * INVALID_WEBHOOK_TOKEN
1160
+ * * INVALID_ROLE
1161
+ * * INVALID_RECIPIENTS
1162
+ * * BULK_DELETE_MESSAGE_TOO_OLD
1163
+ * * INVALID_FORM_BODY
1164
+ * * INVITE_ACCEPTED_TO_GUILD_NOT_CONTAINING_BOT
1165
+ * * INVALID_API_VERSION
1166
+ * * FILE_UPLOADED_EXCEEDS_MAXIMUM_SIZE
1167
+ * * INVALID_FILE_UPLOADED
1168
+ * * GIFT_CODE_CLAIMED
1169
+ * * CANNOT_SELF_REDEEM_GIFT
1170
+ * * INVALID_GUILD
1171
+ * * INVALID_MESSAGE_TYPE
1172
+ * * PAYMENT_SOURCE_REQUIRED
1173
+ * * CANNOT_DELETE_COMMUNITY_REQUIRED_CHANNEL
1174
+ * * INVALID_STICKER_SENT
1175
+ * * INVALID_OPERATION_ON_ARCHIVED_THREAD
1176
+ * * INVALID_THREAD_NOTIFICATION_SETTINGS
1177
+ * * PARAMETER_EARLIER_THAN_CREATION
1178
+ * * GUILD_NOT_AVAILABLE_IN_LOCATION
1179
+ * * GUILD_MONETIZATION_REQUIRED
1180
+ * * INSUFFICIENT_BOOSTS
1181
+ * * INVALID_JSON
1182
+ * * TWO_FACTOR_REQUIRED
1183
+ * * INVALID_TWO_FACTOR_CODE
1184
+ * * NO_USERS_WITH_DISCORDTAG_EXIST
1185
+ * * REACTION_BLOCKED
1186
+ * * RESOURCE_OVERLOADED
1187
+ * * STAGE_ALREADY_OPEN
1188
+ * * CANNOT_REPLY_WITHOUT_READ_MESSAGE_HISTORY_PERMISSION
1189
+ * * MESSAGE_ALREADY_HAS_THREAD
1190
+ * * THREAD_LOCKED
1191
+ * * MAXIMUM_ACTIVE_THREADS
1192
+ * * MAXIMUM_ACTIVE_ANNOUNCEMENT_THREADS
1193
+ * * INVALID_JSON_FOR_UPLOADED_LOTTIE_FILE
1194
+ * * UPLOADED_LOTTIES_CANNOT_CONTAIN_RASTERIZED_IMAGES
1195
+ * * STICKER_MAXIMUM_FRAMERATE_EXCEEDED
1196
+ * * STICKER_FRAME_COUNT_EXCEEDS_MAXIMUM_OF_1000_FRAMES
1197
+ * * LOTTIE_ANIMATION_MAXIMUM_DIMENSIONS_EXCEEDED
1198
+ * * STICKER_FRAME_RATE_IS_TOO_SMALL_OR_TOO_LARGE
1199
+ * * STICKER_ANIMATION_DURATION_EXCEEDS_MAXIMUM_OF_5_SECONDS
1200
+ * * CANNOT_UPDATE_A_FINISHED_EVENT
1201
+ * * FAILED_TO_CREATE_STAGE_NEEDED_FOR_STAGE_EVENT
1202
+ * @typedef {string} APIError
1203
+ * @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes}
1204
+ * @see {@link https://gist.github.com/Dziurwa14/de2498e5ee28d2089f095aa037957cbb}
1205
+ */
1206
+ exports.APIErrors = {
1207
+ UNKNOWN_ACCOUNT: 10001,
1208
+ UNKNOWN_APPLICATION: 10002,
1209
+ UNKNOWN_CHANNEL: 10003,
1210
+ UNKNOWN_GUILD: 10004,
1211
+ UNKNOWN_INTEGRATION: 10005,
1212
+ UNKNOWN_INVITE: 10006,
1213
+ UNKNOWN_MEMBER: 10007,
1214
+ UNKNOWN_MESSAGE: 10008,
1215
+ UNKNOWN_OVERWRITE: 10009,
1216
+ UNKNOWN_PROVIDER: 10010,
1217
+ UNKNOWN_ROLE: 10011,
1218
+ UNKNOWN_TOKEN: 10012,
1219
+ UNKNOWN_USER: 10013,
1220
+ UNKNOWN_EMOJI: 10014,
1221
+ UNKNOWN_WEBHOOK: 10015,
1222
+ UNKNOWN_WEBHOOK_SERVICE: 10016,
1223
+ UNKNOWN_SESSION: 10020,
1224
+ UNKNOWN_BAN: 10026,
1225
+ UNKNOWN_SKU: 10027,
1226
+ UNKNOWN_STORE_LISTING: 10028,
1227
+ UNKNOWN_ENTITLEMENT: 10029,
1228
+ UNKNOWN_BUILD: 10030,
1229
+ UNKNOWN_LOBBY: 10031,
1230
+ UNKNOWN_BRANCH: 10032,
1231
+ UNKNOWN_STORE_DIRECTORY_LAYOUT: 10033,
1232
+ UNKNOWN_REDISTRIBUTABLE: 10036,
1233
+ UNKNOWN_GIFT_CODE: 10038,
1234
+ UNKNOWN_STREAM: 10049,
1235
+ UNKNOWN_PREMIUM_SERVER_SUBSCRIBE_COOLDOWN: 10050,
1236
+ UNKNOWN_GUILD_TEMPLATE: 10057,
1237
+ UNKNOWN_DISCOVERABLE_SERVER_CATEGORY: 10059,
1238
+ UNKNOWN_STICKER: 10060,
1239
+ UNKNOWN_INTERACTION: 10062,
1240
+ UNKNOWN_APPLICATION_COMMAND: 10063,
1241
+ UNKNOWN_APPLICATION_COMMAND_PERMISSIONS: 10066,
1242
+ UNKNOWN_STAGE_INSTANCE: 10067,
1243
+ UNKNOWN_GUILD_MEMBER_VERIFICATION_FORM: 10068,
1244
+ UNKNOWN_GUILD_WELCOME_SCREEN: 10069,
1245
+ UNKNOWN_GUILD_SCHEDULED_EVENT: 10070,
1246
+ UNKNOWN_GUILD_SCHEDULED_EVENT_USER: 10071,
1247
+ BOT_PROHIBITED_ENDPOINT: 20001,
1248
+ BOT_ONLY_ENDPOINT: 20002,
1249
+ RPC_PROXY_DISALLOWED: 20003,
1250
+ CANNOT_SEND_EXPLICIT_CONTENT: 20009,
1251
+ ACCOUNT_SCHEDULED_FOR_DELETION: 20011,
1252
+ NOT_AUTHORIZED: 20012,
1253
+ ACCOUNT_DISABLED: 20013,
1254
+ SLOWMODE_RATE_LIMIT: 20016,
1255
+ ACCOUNT_OWNER_ONLY: 20018,
1256
+ ANNOUNCEMENT_EDIT_LIMIT_EXCEEDED: 20022,
1257
+ UNDER_MINIMUM_AGE: 20024,
1258
+ QUARANTINED: 20026,
1259
+ CHANNEL_HIT_WRITE_RATELIMIT: 20028,
1260
+ SERVER_HIT_WRITE_RATELIMIT: 20029,
1261
+ CONTENT_NOT_ALLOWED: 20031,
1262
+ GUILD_PREMIUM_LEVEL_TOO_LOW: 20035,
1263
+ VANITY_URL_REQUIRED_FOR_PUBLISHED_GUILDS: 20040,
1264
+ MAXIMUM_GUILDS: 30001,
1265
+ MAXIMUM_FRIENDS: 30002,
1266
+ MAXIMUM_PINS: 30003,
1267
+ MAXIMUM_RECIPIENTS: 30004,
1268
+ MAXIMUM_ROLES: 30005,
1269
+ MAXIMUN_USERNAMES: 30006,
1270
+ MAXIMUM_WEBHOOKS: 30007,
1271
+ MAXIMUM_EMOJIS: 30008,
1272
+ MAXIMUM_REACTIONS: 30010,
1273
+ MAXIMUM_CHANNELS: 30013,
1274
+ MAXIMUM_ATTACHMENTS: 30015,
1275
+ MAXIMUM_INVITES: 30016,
1276
+ MAXIMUM_ANIMATED_EMOJIS: 30018,
1277
+ MAXIMUM_SERVER_MEMBERS: 30019,
1278
+ NOT_ENOUGH_GUILD_MEMBERS: 30029,
1279
+ MAXIMUM_NUMBER_OF_SERVER_CATEGORIES: 30030,
1280
+ GUILD_ALREADY_HAS_TEMPLATE: 30031,
1281
+ MAXIMUM_THREAD_PARTICIPANTS: 30033,
1282
+ MAXIMUM_NON_GUILD_MEMBERS_BANS: 30035,
1283
+ MAXIMUM_BAN_FETCHES: 30037,
1284
+ MAXIMUM_NUMBER_OF_UNCOMPLETED_GUILD_SCHEDULED_EVENTS_REACHED: 30038,
1285
+ MAXIMUM_NUMBER_OF_STICKERS_REACHED: 30039,
1286
+ MAXIMUM_PRUNE_REQUESTS: 30040,
1287
+ MAXIMUM_GUILD_WIDGET_SETTINGS_UPDATE: 30042,
1288
+ MAXIMUM_NUMBER_OF_PREMIUM_EMOJIS: 30056,
1289
+ UNAUTHORIZED: 40001,
1290
+ ACCOUNT_VERIFICATION_REQUIRED: 40002,
1291
+ DIRECT_MESSAGES_TOO_FAST: 40003,
1292
+ SEND_MESSAGE_TEMPORARILY_DISABLED: 40004,
1293
+ REQUEST_ENTITY_TOO_LARGE: 40005,
1294
+ FEATURE_TEMPORARILY_DISABLED: 40006,
1295
+ USER_BANNED: 40007,
1296
+ CONNECTION_REVOKED: 40012,
1297
+ DELETE_ACCOUNT_TRANSFER_TEAM_OWNERSHIP: 40028,
1298
+ TARGET_USER_NOT_CONNECTED_TO_VOICE: 40032,
1299
+ ALREADY_CROSSPOSTED: 40033,
1300
+ TAG_REQUIRED: 40067,
1301
+ INVITES_DISABLED: 40069,
1302
+ MISSING_ACCESS: 50001,
1303
+ INVALID_ACCOUNT_TYPE: 50002,
1304
+ CANNOT_EXECUTE_ON_DM: 50003,
1305
+ EMBED_DISABLED: 50004,
1306
+ CANNOT_EDIT_MESSAGE_BY_OTHER: 50005,
1307
+ CANNOT_SEND_EMPTY_MESSAGE: 50006,
1308
+ CANNOT_MESSAGE_USER: 50007,
1309
+ CANNOT_SEND_MESSAGES_IN_VOICE_CHANNEL: 50008,
1310
+ CHANNEL_VERIFICATION_LEVEL_TOO_HIGH: 50009,
1311
+ OAUTH2_APPLICATION_BOT_ABSENT: 50010,
1312
+ MAXIMUM_OAUTH2_APPLICATIONS: 50011,
1313
+ INVALID_OAUTH_STATE: 50012,
1314
+ MISSING_PERMISSIONS: 50013,
1315
+ INVALID_AUTHENTICATION_TOKEN: 50014,
1316
+ NOTE_TOO_LONG: 50015,
1317
+ INVALID_BULK_DELETE_QUANTITY: 50016,
1318
+ INVALID_MFA_LEVEL: 50017,
1319
+ INVALID_PASSWORD: 50018,
1320
+ CANNOT_PIN_MESSAGE_IN_OTHER_CHANNEL: 50019,
1321
+ INVALID_OR_TAKEN_INVITE_CODE: 50020,
1322
+ CANNOT_EXECUTE_ON_SYSTEM_MESSAGE: 50021,
1323
+ INVALID_PHONE_NUMBER: 50022,
1324
+ INVALID_CLIENT_ID: 50023,
1325
+ CANNOT_EXECUTE_ON_CHANNEL_TYPE: 50024,
1326
+ INVALID_OAUTH_TOKEN: 50025,
1327
+ MISSING_OAUTH_SCOPE: 50026,
1328
+ INVALID_WEBHOOK_TOKEN: 50027,
1329
+ INVALID_ROLE: 50028,
1330
+ INVALID_RECIPIENTS: 50033,
1331
+ BULK_DELETE_MESSAGE_TOO_OLD: 50034,
1332
+ INVALID_FORM_BODY: 50035,
1333
+ INVITE_ACCEPTED_TO_GUILD_NOT_CONTAINING_BOT: 50036,
1334
+ INVALID_API_VERSION: 50041,
1335
+ FILE_UPLOADED_EXCEEDS_MAXIMUM_SIZE: 50045,
1336
+ INVALID_FILE_UPLOADED: 50046,
1337
+ GIFT_CODE_CLAIMED: 50050,
1338
+ INVALID_GIFT_REDEMPTION_OWNED: 50051,
1339
+ CANNOT_SELF_REDEEM_GIFT: 50054,
1340
+ INVALID_GUILD: 50055,
1341
+ INVALID_MESSAGE_TYPE: 50068,
1342
+ PAYMENT_SOURCE_REQUIRED: 50070,
1343
+ CANNOT_DELETE_COMMUNITY_REQUIRED_CHANNEL: 50074,
1344
+ INVALID_STICKER_SENT: 50081,
1345
+ INVALID_OPERATION_ON_ARCHIVED_THREAD: 50083,
1346
+ INVALID_THREAD_NOTIFICATION_SETTINGS: 50084,
1347
+ PARAMETER_EARLIER_THAN_CREATION: 50085,
1348
+ GUILD_NOT_AVAILABLE_IN_LOCATION: 50095,
1349
+ INVALID_CANNOT_FRIEND_SELF: 50096,
1350
+ GUILD_MONETIZATION_REQUIRED: 50097,
1351
+ INSUFFICIENT_BOOSTS: 50101,
1352
+ INVALID_USER_SETTINGS_DATA: 50105,
1353
+ INVALID_ACTIVITY_LAUNCH_NO_ACCESS: 50106,
1354
+ INVALID_ACTIVITY_LAUNCH_PREMIUM_TIER: 50107,
1355
+ INVALID_ACTIVITY_LAUNCH_CONCURRENT_ACTIVITIES: 50108,
1356
+ INVALID_JSON: 50109,
1357
+ INVALID_FILE_ASSET_SIZE_RESIZE_GIF: 50138,
1358
+ CANNOT_MIX_SUBSCRIPTION_AND_NON_SUBSCRIPTION_ROLES_FOR_EMOJI: 50144,
1359
+ CANNOT_CONVERT_PREMIUM_EMOJI_TO_NORMAL_EMOJI: 50145,
1360
+ VOICE_MESSAGES_DO_NOT_SUPPORT_ADDITIONAL_CONTENT: 50159,
1361
+ VOICE_MESSAGES_MUST_HAVE_A_SINGLE_AUDIO_ATTACHMENT: 50160,
1362
+ VOICE_MESSAGES_MUST_HAVE_SUPPORTING_METADATA: 50161,
1363
+ VOICE_MESSAGES_CANNOT_BE_EDITED: 50162,
1364
+ YOU_CANNOT_SEND_VOICE_MESSAGES_IN_THIS_CHANNEL: 50173,
1365
+ TWO_FACTOR_ENABLED: 60001,
1366
+ TWO_FACTOR_DISABLED: 60002,
1367
+ TWO_FACTOR_REQUIRED: 60003,
1368
+ TWO_FACTOR_UNVERIFIED: 60004,
1369
+ TWO_FACTOR_INVALID_SECRET: 60005,
1370
+ TWO_FACTOR_INVALID_TICKET: 60006,
1371
+ INVALID_TWO_FACTOR_CODE: 60008,
1372
+ TWO_FACTOR_INVALID_SESSION: 60009,
1373
+ PHONE_NUMBER_UNABLE_TO_SEND: 70003,
1374
+ PHONE_VERIFICATION_REQUIRED: 70007,
1375
+ RELATIONSHIP_INCOMING_DISABLED: 80000,
1376
+ RELATIONSHIP_INCOMING_BLOCKED: 80001,
1377
+ RELATIONSHIP_INVALUD_USER_BOT: 80002,
1378
+ RELATIONSHIP_INVALID_SELF: 80003,
1379
+ NO_USERS_WITH_DISCORDTAG_EXIST: 80004,
1380
+ RELATIONSHIP_ALREADY_FRIENDS: 80007,
1381
+ REACTION_BLOCKED: 90001,
1382
+ INVALID_GIFT_REDEMPTION_SUBSCRIPTION_MANAGED: 100021,
1383
+ INVALID_GIFT_REDEMPTION_SUBSCRIPTION_INCOMPATIBLE: 100023,
1384
+ INVALID_GIFT_REDEMPTION_INVOICE_OPEN: 100024,
1385
+ BILLING_NON_REFUNDABLE_PAYMENT_SOURCE: 100060,
1386
+ LISTING_ALREADY_JOINED: 120000,
1387
+ LISTING_TOO_MANY_MEMBERS: 120001,
1388
+ LISTING_JOIN_BLOCKED: 120002,
1389
+ RESOURCE_OVERLOADED: 130000,
1390
+ STAGE_ALREADY_OPEN: 150006,
1391
+ CANNOT_REPLY_WITHOUT_READ_MESSAGE_HISTORY_PERMISSION: 160002,
1392
+ MESSAGE_ALREADY_HAS_THREAD: 160004,
1393
+ THREAD_LOCKED: 160005,
1394
+ MAXIMUM_ACTIVE_THREADS: 160006,
1395
+ MAXIMUM_ACTIVE_ANNOUNCEMENT_THREADS: 160007,
1396
+ INVALID_JSON_FOR_UPLOADED_LOTTIE_FILE: 170001,
1397
+ UPLOADED_LOTTIES_CANNOT_CONTAIN_RASTERIZED_IMAGES: 170002,
1398
+ STICKER_MAXIMUM_FRAMERATE_EXCEEDED: 170003,
1399
+ STICKER_FRAME_COUNT_EXCEEDS_MAXIMUM_OF_1000_FRAMES: 170004,
1400
+ LOTTIE_ANIMATION_MAXIMUM_DIMENSIONS_EXCEEDED: 170005,
1401
+ STICKER_FRAME_RATE_IS_TOO_SMALL_OR_TOO_LARGE: 170006,
1402
+ STICKER_ANIMATION_DURATION_EXCEEDS_MAXIMUM_OF_5_SECONDS: 170007,
1403
+ POGGERMODE_TEMPORARILY_DISABLED: 170008,
1404
+ CANNOT_UPDATE_A_FINISHED_EVENT: 180000,
1405
+ FAILED_TO_CREATE_STAGE_NEEDED_FOR_STAGE_EVENT: 180002,
1406
+ AUTOMOD_MESSAGE_BLOCKED: 200000,
1407
+ AUTOMOD_TITLE_BLOCKED: 200001,
1408
+ HARMFUL_LINK_MESSAGE_BLOCKED: 240000,
1409
+ };
1410
+
1411
+ /**
1412
+ * The value set for a guild's default message notifications, e.g. `ALL_MESSAGES`. Here are the available types:
1413
+ * * ALL_MESSAGES
1414
+ * * ONLY_MENTIONS
1415
+ * @typedef {string} DefaultMessageNotificationLevel
1416
+ * @see {@link https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level}
1417
+ */
1418
+ exports.DefaultMessageNotificationLevels = createEnum(['ALL_MESSAGES', 'ONLY_MENTIONS']);
1419
+
1420
+ /**
1421
+ * The value set for a team member's membership state:
1422
+ * * INVITED
1423
+ * * ACCEPTED
1424
+ * @typedef {string} MembershipState
1425
+ * @see {@link https://discord.com/developers/docs/topics/teams#data-models-membership-state-enum}
1426
+ */
1427
+ exports.MembershipStates = createEnum([null, 'INVITED', 'ACCEPTED']);
1428
+
1429
+ /**
1430
+ * The value set for a webhook's type:
1431
+ * * Incoming
1432
+ * * Channel Follower
1433
+ * * Application
1434
+ * @typedef {string} WebhookType
1435
+ * @see {@link https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types}
1436
+ */
1437
+ exports.WebhookTypes = createEnum([null, 'Incoming', 'Channel Follower', 'Application']);
1438
+
1439
+ /**
1440
+ * The value set for a sticker's type:
1441
+ * * STANDARD
1442
+ * * GUILD
1443
+ * @typedef {string} StickerType
1444
+ * @see {@link https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-types}
1445
+ */
1446
+ exports.StickerTypes = createEnum([null, 'STANDARD', 'GUILD']);
1447
+
1448
+ /**
1449
+ * The value set for a sticker's format type:
1450
+ * * PNG
1451
+ * * APNG
1452
+ * * LOTTIE
1453
+ * * GIF
1454
+ * @typedef {string} StickerFormatType
1455
+ * @see {@link https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-format-types}
1456
+ */
1457
+ exports.StickerFormatTypes = createEnum([null, 'PNG', 'APNG', 'LOTTIE', 'GIF']);
1458
+
1459
+ /**
1460
+ * An overwrite type:
1461
+ * * role
1462
+ * * member
1463
+ * @typedef {string} OverwriteType
1464
+ * @see {@link https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure}
1465
+ */
1466
+ exports.OverwriteTypes = createEnum(['role', 'member']);
1467
+
1468
+ /* eslint-disable max-len */
1469
+ /**
1470
+ * The type of an {@link ApplicationCommand} object:
1471
+ * * CHAT_INPUT
1472
+ * * USER
1473
+ * * MESSAGE
1474
+ * @typedef {string} ApplicationCommandType
1475
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types}
1476
+ */
1477
+ exports.ApplicationCommandTypes = createEnum([null, 'CHAT_INPUT', 'USER', 'MESSAGE']);
1478
+
1479
+ /**
1480
+ * The type of an {@link ApplicationCommandOption} object:
1481
+ * * SUB_COMMAND
1482
+ * * SUB_COMMAND_GROUP
1483
+ * * STRING
1484
+ * * INTEGER
1485
+ * * BOOLEAN
1486
+ * * USER
1487
+ * * CHANNEL
1488
+ * * ROLE
1489
+ * * MENTIONABLE
1490
+ * * NUMBER
1491
+ * * ATTACHMENT
1492
+ * @typedef {string} ApplicationCommandOptionType
1493
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type}
1494
+ */
1495
+ exports.ApplicationCommandOptionTypes = createEnum([
1496
+ null,
1497
+ 'SUB_COMMAND',
1498
+ 'SUB_COMMAND_GROUP',
1499
+ 'STRING',
1500
+ 'INTEGER',
1501
+ 'BOOLEAN',
1502
+ 'USER',
1503
+ 'CHANNEL',
1504
+ 'ROLE',
1505
+ 'MENTIONABLE',
1506
+ 'NUMBER',
1507
+ 'ATTACHMENT',
1508
+ ]);
1509
+
1510
+ /**
1511
+ * The type of an {@link ApplicationCommandPermissions} object:
1512
+ * * ROLE
1513
+ * * USER
1514
+ * @typedef {string} ApplicationCommandPermissionType
1515
+ * @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type}
1516
+ */
1517
+ exports.ApplicationCommandPermissionTypes = createEnum([null, 'ROLE', 'USER']);
1518
+
1519
+ /**
1520
+ * Each metadata type offers a comparison operation that allows
1521
+ * guilds to configure role requirements based on metadata values stored by the bot.
1522
+ * Bots specify a metadata value for each user and guilds specify
1523
+ * the required guild's configured value within the guild role settings.
1524
+ * All available channel types:
1525
+ * * INTEGER_LESS_THAN_OR_EQUAL
1526
+ * * INTEGER_GREATER_THAN_OR_EQUAL
1527
+ * * INTEGER_EQUAL
1528
+ * * INTEGER_NOT_EQUAL
1529
+ * * DATATIME_LESS_THAN_OR_EQUAL
1530
+ * * DATATIME_GREATER_THAN_OR_EQUAL
1531
+ * * BOOLEAN_EQUAL
1532
+ * * BOOLEAN_NOT_EQUAL
1533
+ * @typedef {string} ApplicationRoleConnectionMetadataType
1534
+ * @see {@link https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-type}
1535
+ */
1536
+ exports.ApplicationRoleConnectionMetadataTypes = createEnum([
1537
+ null,
1538
+ 'INTEGER_LESS_THAN_OR_EQUAL',
1539
+ 'INTEGER_GREATER_THAN_OR_EQUAL',
1540
+ 'INTEGER_EQUAL',
1541
+ 'INTEGER_NOT_EQUAL',
1542
+ 'DATATIME_LESS_THAN_OR_EQUAL',
1543
+ 'DATATIME_GREATER_THAN_OR_EQUAL',
1544
+ 'BOOLEAN_EQUAL',
1545
+ 'BOOLEAN_NOT_EQUAL',
1546
+ ]);
1547
+
1548
+ /**
1549
+ * The type of an {@link AutoModerationRuleTriggerTypes} object:
1550
+ * * KEYWORD
1551
+ * * SPAM
1552
+ * * KEYWORD_PRESET
1553
+ * * MENTION_SPAM
1554
+ * @typedef {string} AutoModerationRuleTriggerType
1555
+ * @see {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types}
1556
+ */
1557
+ exports.AutoModerationRuleTriggerTypes = createEnum([null, 'KEYWORD', null, 'SPAM', 'KEYWORD_PRESET', 'MENTION_SPAM']);
1558
+
1559
+ /**
1560
+ * The type of an {@link AutoModerationRuleKeywordPresetTypes} object:
1561
+ * * KEYWORD
1562
+ * * SPAM
1563
+ * * KEYWORD_PRESET
1564
+ * * MENTION_SPAM
1565
+ * @typedef {string} AutoModerationRuleKeywordPresetType
1566
+ * @see {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-preset-types}
1567
+ */
1568
+ exports.AutoModerationRuleKeywordPresetTypes = createEnum([null, 'PROFANITY', 'SEXUAL_CONTENT', 'SLURS']);
1569
+ /**
1570
+ * The type of an {@link AutoModerationActionTypes} object:
1571
+ * * BLOCK_MESSAGE
1572
+ * * SEND_ALERT_MESSAGE
1573
+ * * TIMEOUT
1574
+ * @typedef {string} AutoModerationActionType
1575
+ * @see {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-types}
1576
+ */
1577
+ exports.AutoModerationActionTypes = createEnum([null, 'BLOCK_MESSAGE', 'SEND_ALERT_MESSAGE', 'TIMEOUT']);
1578
+
1579
+ /**
1580
+ * The type of an {@link AutoModerationRuleEventTypes} object:
1581
+ * * MESSAGE_SEND
1582
+ * @typedef {string} AutoModerationRuleEventType
1583
+ * @see {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-event-types}
1584
+ */
1585
+
1586
+ exports.AutoModerationRuleEventTypes = createEnum([null, 'MESSAGE_SEND']);
1587
+
1588
+ /**
1589
+ * The type of an {@link Interaction} object:
1590
+ * * PING
1591
+ * * APPLICATION_COMMAND
1592
+ * * MESSAGE_COMPONENT
1593
+ * * APPLICATION_COMMAND_AUTOCOMPLETE
1594
+ * * MODAL_SUBMIT
1595
+ * @typedef {string} InteractionType
1596
+ * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type}
1597
+ */
1598
+ exports.InteractionTypes = createEnum([
1599
+ null,
1600
+ 'PING',
1601
+ 'APPLICATION_COMMAND',
1602
+ 'MESSAGE_COMPONENT',
1603
+ 'APPLICATION_COMMAND_AUTOCOMPLETE',
1604
+ 'MODAL_SUBMIT',
1605
+ ]);
1606
+
1607
+ /**
1608
+ * The type of an interaction response:
1609
+ * * PONG
1610
+ * * CHANNEL_MESSAGE_WITH_SOURCE
1611
+ * * DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE
1612
+ * * DEFERRED_MESSAGE_UPDATE
1613
+ * * UPDATE_MESSAGE
1614
+ * * APPLICATION_COMMAND_AUTOCOMPLETE_RESULT
1615
+ * * MODAL
1616
+ * @typedef {string} InteractionResponseType
1617
+ * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type}
1618
+ */
1619
+ exports.InteractionResponseTypes = createEnum([
1620
+ null,
1621
+ 'PONG',
1622
+ null,
1623
+ null,
1624
+ 'CHANNEL_MESSAGE_WITH_SOURCE',
1625
+ 'DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE',
1626
+ 'DEFERRED_MESSAGE_UPDATE',
1627
+ 'UPDATE_MESSAGE',
1628
+ 'APPLICATION_COMMAND_AUTOCOMPLETE_RESULT',
1629
+ 'MODAL',
1630
+ ]);
1631
+
1632
+ /**
1633
+ * The type of a message component
1634
+ * * ACTION_ROW
1635
+ * * BUTTON
1636
+ * * TEXT_INPUT
1637
+ * * STRING_SELECT
1638
+ * * USER_SELECT
1639
+ * * ROLE_SELECT
1640
+ * * MENTIONABLE_SELECT
1641
+ * * CHANNEL_SELECT
1642
+ * * SELECT_MENU (deprecated)
1643
+ * @typedef {string} MessageComponentType
1644
+ * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object-component-types}
1645
+ */
1646
+ exports.MessageComponentTypes = {
1647
+ ...createEnum([
1648
+ null,
1649
+ 'ACTION_ROW',
1650
+ 'BUTTON',
1651
+ 'STRING_SELECT',
1652
+ 'TEXT_INPUT',
1653
+ 'USER_SELECT',
1654
+ 'ROLE_SELECT',
1655
+ 'MENTIONABLE_SELECT',
1656
+ 'CHANNEL_SELECT',
1657
+ ]),
1658
+ /** @deprecated Use `STRING_SELECT` instead */
1659
+ SELECT_MENU: 3,
1660
+ /** @deprecated Use `STRING_SELECT` instead */
1661
+ 3: 'SELECT_MENU',
1662
+ };
1663
+
1664
+ /**
1665
+ * The types of components that are select menus. The available types are:
1666
+ * * SELECT_MENU (deprecated)
1667
+ * * STRING_MENU
1668
+ * * USER_SELECT
1669
+ * * ROLE_SELECT
1670
+ * * MENTIONABLE_SELECT
1671
+ * * CHANNEL_SELECT
1672
+ * @typedef {string} SelectMenuComponentType
1673
+ * @see {@link https://discord.com/developers/docs/interactions/message-components#component-object-component-types}
1674
+ */
1675
+ exports.SelectMenuComponentTypes = {
1676
+ ...createEnum([
1677
+ ...new Array(3).fill(null),
1678
+ 'STRING_MENU',
1679
+ null,
1680
+ 'USER_SELECT',
1681
+ 'ROLE_SELECT',
1682
+ 'MENTIONABLE_SELECT',
1683
+ 'CHANNEL_SELECT',
1684
+ ]),
1685
+ /** @deprecated Use `STRING_SELECT` instead */
1686
+ SELECT_MENU: 3,
1687
+ };
1688
+
1689
+ /**
1690
+ * The style of a message button
1691
+ * * PRIMARY
1692
+ * * SECONDARY
1693
+ * * SUCCESS
1694
+ * * DANGER
1695
+ * * LINK
1696
+ * @typedef {string} MessageButtonStyle
1697
+ * @see {@link https://discord.com/developers/docs/interactions/message-components#button-object-button-styles}
1698
+ */
1699
+ exports.MessageButtonStyles = createEnum([null, 'PRIMARY', 'SECONDARY', 'SUCCESS', 'DANGER', 'LINK']);
1700
+
1701
+ /**
1702
+ * The required MFA level for a guild
1703
+ * * NONE
1704
+ * * ELEVATED
1705
+ * @typedef {string} MFALevel
1706
+ * @see {@link https://discord.com/developers/docs/resources/guild#guild-object-mfa-level}
1707
+ */
1708
+ exports.MFALevels = createEnum(['NONE', 'ELEVATED']);
1709
+
1710
+ /**
1711
+ * NSFW level of a Guild:
1712
+ * * DEFAULT
1713
+ * * EXPLICIT
1714
+ * * SAFE
1715
+ * * AGE_RESTRICTED
1716
+ * @typedef {string} NSFWLevel
1717
+ * @see {@link https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level}
1718
+ */
1719
+ exports.NSFWLevels = createEnum(['DEFAULT', 'EXPLICIT', 'SAFE', 'AGE_RESTRICTED']);
1720
+
1721
+ /**
1722
+ * Privacy level of a {@link StageInstance} object:
1723
+ * * PUBLIC
1724
+ * * GUILD_ONLY
1725
+ * @typedef {string} PrivacyLevel
1726
+ * @see {@link https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-privacy-level}
1727
+ */
1728
+ exports.PrivacyLevels = createEnum([null, 'PUBLIC', 'GUILD_ONLY']);
1729
+
1730
+ /**
1731
+ * The style of a text input component
1732
+ * * SHORT
1733
+ * * PARAGRAPH
1734
+ * @typedef {string} TextInputStyle
1735
+ * @see {@link https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-styles}
1736
+ */
1737
+ exports.TextInputStyles = createEnum([null, 'SHORT', 'PARAGRAPH']);
1738
+
1739
+ /**
1740
+ * Privacy level of a {@link GuildScheduledEvent} object:
1741
+ * * GUILD_ONLY
1742
+ * @typedef {string} GuildScheduledEventPrivacyLevel
1743
+ * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level}
1744
+ */
1745
+ exports.GuildScheduledEventPrivacyLevels = createEnum([null, null, 'GUILD_ONLY']);
1746
+
1747
+ /**
1748
+ * Relationship Enums:
1749
+ * * 0: NONE
1750
+ * * 1: FRIEND
1751
+ * * 2: BLOCKED
1752
+ * * 3: PENDING_INCOMING
1753
+ * * 4: PENDING_OUTGOING
1754
+ * * 5: IMPLICIT
1755
+ * @typedef {string} RelationshipTypes
1756
+ * @see {@link https://luna.gitlab.io/discord-unofficial-docs/relationships.html}
1757
+ */
1758
+
1759
+ exports.RelationshipTypes = createEnum([
1760
+ 'NONE',
1761
+ 'FRIEND',
1762
+ 'BLOCKED',
1763
+ 'PENDING_INCOMING',
1764
+ 'PENDING_OUTGOING',
1765
+ 'IMPLICIT',
1766
+ ]);
1767
+
1768
+ /**
1769
+ * The premium tier (Server Boost level) of a guild:
1770
+ * * NONE
1771
+ * * TIER_1
1772
+ * * TIER_2
1773
+ * * TIER_3
1774
+ * @typedef {string} PremiumTier
1775
+ * @see {@link https://discord.com/developers/docs/resources/guild#guild-object-premium-tier}
1776
+ */
1777
+ exports.PremiumTiers = createEnum(['NONE', 'TIER_1', 'TIER_2', 'TIER_3']);
1778
+
1779
+ /**
1780
+ * The status of a {@link GuildScheduledEvent}:
1781
+ * * SCHEDULED
1782
+ * * ACTIVE
1783
+ * * COMPLETED
1784
+ * * CANCELED
1785
+ * @typedef {string} GuildScheduledEventStatus
1786
+ * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-status}
1787
+ */
1788
+ exports.GuildScheduledEventStatuses = createEnum([null, 'SCHEDULED', 'ACTIVE', 'COMPLETED', 'CANCELED']);
1789
+
1790
+ /**
1791
+ * The entity type of a {@link GuildScheduledEvent}:
1792
+ * * NONE
1793
+ * * STAGE_INSTANCE
1794
+ * * VOICE
1795
+ * * EXTERNAL
1796
+ * @typedef {string} GuildScheduledEventEntityType
1797
+ * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-types}
1798
+ */
1799
+ exports.GuildScheduledEventEntityTypes = createEnum([null, 'STAGE_INSTANCE', 'VOICE', 'EXTERNAL']);
1800
+ /* eslint-enable max-len */
1801
+ /**
1802
+ * The camera video quality mode of a {@link VoiceChannel}:
1803
+ * * AUTO
1804
+ * * FULL
1805
+ * @typedef {string} VideoQualityMode
1806
+ * @see {@link https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes}
1807
+ */
1808
+ exports.VideoQualityModes = createEnum([null, 'AUTO', 'FULL']);
1809
+
1810
+ /**
1811
+ * Sort {@link ForumChannel} posts by ?
1812
+ * * LATEST_ACTIVITY
1813
+ * * CREATION_DATE
1814
+ * @typedef {string} SortOrderType
1815
+ * @see {@link https://discord.com/developers/docs/resources/channel/#channel-object-sort-order-types}
1816
+ */
1817
+ exports.SortOrderTypes = createEnum([null, 'LATEST_ACTIVITY', 'CREATION_DATE']);
1818
+
1819
+ /**
1820
+ * The default forum layout to set on the {@link ForumChannel}
1821
+ * * NOT_SET
1822
+ * * LIST_VIEW
1823
+ * * GALLERY_VIEW
1824
+ * @typedef {string} ForumLayoutType
1825
+ * @see {@link https://discord.com/developers/docs/resources/channel/#channel-object-forum-layout-types}
1826
+ */
1827
+ exports.ForumLayoutTypes = createEnum(['NOT_SET', 'LIST_VIEW', 'GALLERY_VIEW']);
1828
+
1829
+ exports._cleanupSymbol = Symbol('djsCleanup');
1830
+
1831
+ function keyMirror(arr) {
1832
+ const tmp = Object.create(null);
1833
+ for (const value of arr) tmp[value] = value;
1834
+ return tmp;
1835
+ }
1836
+
1837
+ function createEnum(keys) {
1838
+ const obj = {};
1839
+ for (const [index, key] of keys.entries()) {
1840
+ if (key === null) continue;
1841
+ obj[key] = index;
1842
+ obj[index] = key;
1843
+ }
1844
+ return obj;
1845
+ }
1846
+
1847
+ /**
1848
+ * @typedef {Object} Constants Constants that can be used in an enum or object-like way.
1849
+ * @property {Object<ActivityType, number>} ActivityTypes The type of an activity of a users presence.
1850
+ * @property {Object<APIError, number>} APIErrors An error encountered while performing an API request.
1851
+ * @property {Object<ApplicationCommandOptionType, number>} ApplicationCommandOptionTypes
1852
+ * The type of an {@link ApplicationCommandOption} object.
1853
+ * @property {Object<ApplicationCommandPermissionType, number>} ApplicationCommandPermissionTypes
1854
+ * The type of an {@link ApplicationCommandPermissions} object.
1855
+ * @property {Object<ApplicationCommandType, number>} ApplicationCommandTypes
1856
+ * The type of an {@link ApplicationCommand} object.
1857
+ * @property {Object<ApplicationRoleConnectionMetadataType, number>} ApplicationRoleConnectionMetadataTypes
1858
+ * The type of an {@link ApplicationRoleConnectionMetadata} object.
1859
+ * @property {Object<AutoModerationActionType, number>} AutoModerationActionTypes
1860
+ * A type of an action which executes whenever a rule is triggered.
1861
+ * @property {Object<AutoModerationRuleEventType, number>} AutoModerationRuleEventTypes Indicates in what event context
1862
+ * a rule should be checked.
1863
+ * @property {Object<AutoModerationRuleKeywordPresetType, number>} AutoModerationRuleKeywordPresetTypes
1864
+ * The internally pre-defined wordsetswhich will be searched for in content
1865
+ * @property {Object<AutoModerationRuleTriggerType, number>} AutoModerationRuleTriggerTypes Characterizes the type
1866
+ * of content which can trigger the rule.
1867
+ * @property {Object<ChannelType, number>} ChannelTypes All available channel types.
1868
+ * @property {ClientApplicationAssetTypes} ClientApplicationAssetTypes The types of an {@link ApplicationAsset} object.
1869
+ * @property {Object<Color, number>} Colors An object with regularly used colors.
1870
+ * @property {Object<DefaultMessageNotificationLevel, number>} DefaultMessageNotificationLevels
1871
+ * The value set for a guilds default message notifications.
1872
+ * @property {Endpoints} Endpoints Object containing functions that return certain endpoints on the API.
1873
+ * @property {Events} Events The types of events emitted by the Client.
1874
+ * @property {Object<ExplicitContentFilterLevel, number>} ExplicitContentFilterLevels
1875
+ * The value set for the explicit content filter levels for a guild.
1876
+ * @property {Object<GuildScheduledEventEntityType, number>} GuildScheduledEventEntityTypes
1877
+ * The entity type of a {@link GuildScheduledEvent} object.
1878
+ * @property {Object<GuildScheduledEventPrivacyLevel, number>} GuildScheduledEventPrivacyLevels
1879
+ * Privacy level of a {@link GuildScheduledEvent} object.
1880
+ * @property {Object<GuildScheduledEventStatus, number>} GuildScheduledEventStatuses
1881
+ * The status of a {@link GuildScheduledEvent} object.
1882
+ * @property {Object<IntegrationExpireBehavior, number>} IntegrationExpireBehaviors
1883
+ * The behavior of expiring subscribers for Integrations.
1884
+ * @property {Object<InteractionResponseType, number>} InteractionResponseTypes The type of an interaction response.
1885
+ * @property {Object<InteractionType, number>} InteractionTypes The type of an {@link Interaction} object.
1886
+ * @property {InviteScope[]} InviteScopes The scopes of an invite.
1887
+ * @property {number} MaxBulkDeletableMessageAge Max bulk deletable message age (Unavailable to selfbots)
1888
+ * @property {Object<MembershipState, number>} MembershipStates The value set for a team members membership state.
1889
+ * @property {Object<MessageButtonStyle, number>} MessageButtonStyles The style of a message button.
1890
+ * @property {Object<MessageComponentType, number>} MessageComponentTypes The type of a message component.
1891
+ * @property {MessageType[]} MessageTypes The type of a {@link Message} object.
1892
+ * @property {Object<SelectMenuComponentType, number>} SelectMenuComponentTypes The type of any select menu.
1893
+ * @property {Object<MFALevel, number>} MFALevels The required MFA level for a guild.
1894
+ * @property {Object<NSFWLevel, number>} NSFWLevels NSFW level of a guild.
1895
+ * @property {Opcodes} Opcodes The types of Opcodes sent to the Gateway.
1896
+ * @property {Object<OverwriteType, number>} OverwriteTypes An overwrite type.
1897
+ * @property {Object} Package The package.json of the library.
1898
+ * @property {Object<PartialType, PartialType>} PartialTypes The type of Structure allowed to be a partial.
1899
+ * @property {Object<PremiumTier, number>} PremiumTiers The premium tier (Server Boost level) of a guild.
1900
+ * @property {Object<PrivacyLevel, number>} PrivacyLevels Privacy level of a {@link StageInstance} object.
1901
+ * @property {ShardEvents} ShardEvents The type of events emitted by a Shard.
1902
+ * @property {Status} Status The available statuses of the client.
1903
+ * @property {Object<StickerFormatType, number>} StickerFormatTypes The value set for a stickers format type.
1904
+ * @property {Object<StickerType, number>} StickerTypes The value set for a stickers type.
1905
+ * @property {SweeperKey[]} SweeperKeys The name of an item to be swept in Sweepers.
1906
+ * @property {SystemMessageType[]} SystemMessageTypes The types of messages that are `System`.
1907
+ * @property {Object<TextInputStyle, number>} TextInputStyles The style of a text input component.
1908
+ * @property {ThreadChannelTypes[]} ThreadChannelTypes The type of a {@link ThreadChannel} object.
1909
+ * @property {string} UserAgent The user agent used for requests.
1910
+ * @property {Object<VerificationLevel, number>} VerificationLevels
1911
+ * The value set for the verification levels for a guild.
1912
+ * @property {Object<VideoQualityMode, number>} VideoQualityModes
1913
+ * The camera video quality mode for a {@link VoiceChannel}.
1914
+ * @property {Object<WebhookType, number>} WebhookTypes The value set for a webhooks type.
1915
+ * @property {WSCodes} WSCodes The types of WebSocket error codes.
1916
+ * @property {Object<WSEventType, WSEventType>} WSEvents The type of a WebSocket message event.
1917
+ */