discord.js-seflbot-v13 1.1.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.js-seflbot-v13 might be problematic. Click here for more details.

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