carbon-proxy 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (520) hide show
  1. package/README.md +237 -0
  2. package/dist/package.json +43 -0
  3. package/dist/src/abstracts/AnySelectMenu.d.ts +40 -0
  4. package/dist/src/abstracts/AnySelectMenu.d.ts.map +1 -0
  5. package/dist/src/abstracts/AnySelectMenu.js +41 -0
  6. package/dist/src/abstracts/AnySelectMenu.js.map +1 -0
  7. package/dist/src/abstracts/AnySelectMenuInteraction.d.ts +12 -0
  8. package/dist/src/abstracts/AnySelectMenuInteraction.d.ts.map +1 -0
  9. package/dist/src/abstracts/AnySelectMenuInteraction.js +19 -0
  10. package/dist/src/abstracts/AnySelectMenuInteraction.js.map +1 -0
  11. package/dist/src/abstracts/Base.d.ts +10 -0
  12. package/dist/src/abstracts/Base.d.ts.map +1 -0
  13. package/dist/src/abstracts/Base.js +11 -0
  14. package/dist/src/abstracts/Base.js.map +1 -0
  15. package/dist/src/abstracts/BaseChannel.d.ts +60 -0
  16. package/dist/src/abstracts/BaseChannel.d.ts.map +1 -0
  17. package/dist/src/abstracts/BaseChannel.js +90 -0
  18. package/dist/src/abstracts/BaseChannel.js.map +1 -0
  19. package/dist/src/abstracts/BaseCommand.d.ts +77 -0
  20. package/dist/src/abstracts/BaseCommand.d.ts.map +1 -0
  21. package/dist/src/abstracts/BaseCommand.js +127 -0
  22. package/dist/src/abstracts/BaseCommand.js.map +1 -0
  23. package/dist/src/abstracts/BaseComponent.d.ts +20 -0
  24. package/dist/src/abstracts/BaseComponent.d.ts.map +1 -0
  25. package/dist/src/abstracts/BaseComponent.js +10 -0
  26. package/dist/src/abstracts/BaseComponent.js.map +1 -0
  27. package/dist/src/abstracts/BaseComponentInteraction.d.ts +18 -0
  28. package/dist/src/abstracts/BaseComponentInteraction.d.ts.map +1 -0
  29. package/dist/src/abstracts/BaseComponentInteraction.js +41 -0
  30. package/dist/src/abstracts/BaseComponentInteraction.js.map +1 -0
  31. package/dist/src/abstracts/BaseGuildChannel.d.ts +61 -0
  32. package/dist/src/abstracts/BaseGuildChannel.d.ts.map +1 -0
  33. package/dist/src/abstracts/BaseGuildChannel.js +125 -0
  34. package/dist/src/abstracts/BaseGuildChannel.js.map +1 -0
  35. package/dist/src/abstracts/BaseGuildTextChannel.d.ts +53 -0
  36. package/dist/src/abstracts/BaseGuildTextChannel.d.ts.map +1 -0
  37. package/dist/src/abstracts/BaseGuildTextChannel.js +89 -0
  38. package/dist/src/abstracts/BaseGuildTextChannel.js.map +1 -0
  39. package/dist/src/abstracts/BaseInteraction.d.ts +166 -0
  40. package/dist/src/abstracts/BaseInteraction.d.ts.map +1 -0
  41. package/dist/src/abstracts/BaseInteraction.js +274 -0
  42. package/dist/src/abstracts/BaseInteraction.js.map +1 -0
  43. package/dist/src/abstracts/BaseListener.d.ts +13 -0
  44. package/dist/src/abstracts/BaseListener.d.ts.map +1 -0
  45. package/dist/src/abstracts/BaseListener.js +8 -0
  46. package/dist/src/abstracts/BaseListener.js.map +1 -0
  47. package/dist/src/abstracts/BaseMessageInteractiveComponent.d.ts +41 -0
  48. package/dist/src/abstracts/BaseMessageInteractiveComponent.d.ts.map +1 -0
  49. package/dist/src/abstracts/BaseMessageInteractiveComponent.js +35 -0
  50. package/dist/src/abstracts/BaseMessageInteractiveComponent.js.map +1 -0
  51. package/dist/src/abstracts/BaseModalComponent.d.ts +9 -0
  52. package/dist/src/abstracts/BaseModalComponent.d.ts.map +1 -0
  53. package/dist/src/abstracts/BaseModalComponent.js +5 -0
  54. package/dist/src/abstracts/BaseModalComponent.js.map +1 -0
  55. package/dist/src/abstracts/GuildThreadOnlyChannel.d.ts +58 -0
  56. package/dist/src/abstracts/GuildThreadOnlyChannel.d.ts.map +1 -0
  57. package/dist/src/abstracts/GuildThreadOnlyChannel.js +102 -0
  58. package/dist/src/abstracts/GuildThreadOnlyChannel.js.map +1 -0
  59. package/dist/src/abstracts/Plugin.d.ts +49 -0
  60. package/dist/src/abstracts/Plugin.d.ts.map +1 -0
  61. package/dist/src/abstracts/Plugin.js +6 -0
  62. package/dist/src/abstracts/Plugin.js.map +1 -0
  63. package/dist/src/adapters/bun/index.d.ts +13 -0
  64. package/dist/src/adapters/bun/index.d.ts.map +1 -0
  65. package/dist/src/adapters/bun/index.js +16 -0
  66. package/dist/src/adapters/bun/index.js.map +1 -0
  67. package/dist/src/adapters/fetch/index.d.ts +11 -0
  68. package/dist/src/adapters/fetch/index.d.ts.map +1 -0
  69. package/dist/src/adapters/fetch/index.js +50 -0
  70. package/dist/src/adapters/fetch/index.js.map +1 -0
  71. package/dist/src/adapters/node/index.d.ts +13 -0
  72. package/dist/src/adapters/node/index.d.ts.map +1 -0
  73. package/dist/src/adapters/node/index.js +17 -0
  74. package/dist/src/adapters/node/index.js.map +1 -0
  75. package/dist/src/classes/Client.d.ts +253 -0
  76. package/dist/src/classes/Client.d.ts.map +1 -0
  77. package/dist/src/classes/Client.js +419 -0
  78. package/dist/src/classes/Client.js.map +1 -0
  79. package/dist/src/classes/Command.d.ts +44 -0
  80. package/dist/src/classes/Command.d.ts.map +1 -0
  81. package/dist/src/classes/Command.js +53 -0
  82. package/dist/src/classes/Command.js.map +1 -0
  83. package/dist/src/classes/CommandWithSubcommandGroups.d.ts +22 -0
  84. package/dist/src/classes/CommandWithSubcommandGroups.d.ts.map +1 -0
  85. package/dist/src/classes/CommandWithSubcommandGroups.js +27 -0
  86. package/dist/src/classes/CommandWithSubcommandGroups.js.map +1 -0
  87. package/dist/src/classes/CommandWithSubcommands.d.ts +19 -0
  88. package/dist/src/classes/CommandWithSubcommands.d.ts.map +1 -0
  89. package/dist/src/classes/CommandWithSubcommands.js +19 -0
  90. package/dist/src/classes/CommandWithSubcommands.js.map +1 -0
  91. package/dist/src/classes/Embed.d.ts +61 -0
  92. package/dist/src/classes/Embed.d.ts.map +1 -0
  93. package/dist/src/classes/Embed.js +75 -0
  94. package/dist/src/classes/Embed.js.map +1 -0
  95. package/dist/src/classes/Listener.d.ts +392 -0
  96. package/dist/src/classes/Listener.d.ts.map +1 -0
  97. package/dist/src/classes/Listener.js +1034 -0
  98. package/dist/src/classes/Listener.js.map +1 -0
  99. package/dist/src/classes/Modal.d.ts +37 -0
  100. package/dist/src/classes/Modal.d.ts.map +1 -0
  101. package/dist/src/classes/Modal.js +28 -0
  102. package/dist/src/classes/Modal.js.map +1 -0
  103. package/dist/src/classes/RequestClient.d.ts +106 -0
  104. package/dist/src/classes/RequestClient.d.ts.map +1 -0
  105. package/dist/src/classes/RequestClient.js +451 -0
  106. package/dist/src/classes/RequestClient.js.map +1 -0
  107. package/dist/src/classes/components/Button.d.ts +52 -0
  108. package/dist/src/classes/components/Button.d.ts.map +1 -0
  109. package/dist/src/classes/components/Button.js +71 -0
  110. package/dist/src/classes/components/Button.js.map +1 -0
  111. package/dist/src/classes/components/ChannelSelectMenu.d.ts +17 -0
  112. package/dist/src/classes/components/ChannelSelectMenu.d.ts.map +1 -0
  113. package/dist/src/classes/components/ChannelSelectMenu.js +22 -0
  114. package/dist/src/classes/components/ChannelSelectMenu.js.map +1 -0
  115. package/dist/src/classes/components/Checkbox.d.ts +12 -0
  116. package/dist/src/classes/components/Checkbox.d.ts.map +1 -0
  117. package/dist/src/classes/components/Checkbox.js +20 -0
  118. package/dist/src/classes/components/Checkbox.js.map +1 -0
  119. package/dist/src/classes/components/CheckboxGroup.d.ts +24 -0
  120. package/dist/src/classes/components/CheckboxGroup.d.ts.map +1 -0
  121. package/dist/src/classes/components/CheckboxGroup.js +37 -0
  122. package/dist/src/classes/components/CheckboxGroup.js.map +1 -0
  123. package/dist/src/classes/components/Container.d.ts +28 -0
  124. package/dist/src/classes/components/Container.d.ts.map +1 -0
  125. package/dist/src/classes/components/Container.js +38 -0
  126. package/dist/src/classes/components/Container.js.map +1 -0
  127. package/dist/src/classes/components/File.d.ts +21 -0
  128. package/dist/src/classes/components/File.d.ts.map +1 -0
  129. package/dist/src/classes/components/File.js +36 -0
  130. package/dist/src/classes/components/File.js.map +1 -0
  131. package/dist/src/classes/components/FileUpload.d.ts +23 -0
  132. package/dist/src/classes/components/FileUpload.d.ts.map +1 -0
  133. package/dist/src/classes/components/FileUpload.js +36 -0
  134. package/dist/src/classes/components/FileUpload.js.map +1 -0
  135. package/dist/src/classes/components/Label.d.ts +31 -0
  136. package/dist/src/classes/components/Label.d.ts.map +1 -0
  137. package/dist/src/classes/components/Label.js +35 -0
  138. package/dist/src/classes/components/Label.js.map +1 -0
  139. package/dist/src/classes/components/MediaGallery.d.ts +22 -0
  140. package/dist/src/classes/components/MediaGallery.d.ts.map +1 -0
  141. package/dist/src/classes/components/MediaGallery.js +32 -0
  142. package/dist/src/classes/components/MediaGallery.js.map +1 -0
  143. package/dist/src/classes/components/MentionableSelectMenu.d.ts +15 -0
  144. package/dist/src/classes/components/MentionableSelectMenu.d.ts.map +1 -0
  145. package/dist/src/classes/components/MentionableSelectMenu.js +20 -0
  146. package/dist/src/classes/components/MentionableSelectMenu.js.map +1 -0
  147. package/dist/src/classes/components/RadioGroup.d.ts +24 -0
  148. package/dist/src/classes/components/RadioGroup.d.ts.map +1 -0
  149. package/dist/src/classes/components/RadioGroup.js +33 -0
  150. package/dist/src/classes/components/RadioGroup.js.map +1 -0
  151. package/dist/src/classes/components/RoleSelectMenu.d.ts +15 -0
  152. package/dist/src/classes/components/RoleSelectMenu.d.ts.map +1 -0
  153. package/dist/src/classes/components/RoleSelectMenu.js +20 -0
  154. package/dist/src/classes/components/RoleSelectMenu.js.map +1 -0
  155. package/dist/src/classes/components/Row.d.ts +28 -0
  156. package/dist/src/classes/components/Row.d.ts.map +1 -0
  157. package/dist/src/classes/components/Row.js +44 -0
  158. package/dist/src/classes/components/Row.js.map +1 -0
  159. package/dist/src/classes/components/Section.d.ts +23 -0
  160. package/dist/src/classes/components/Section.d.ts.map +1 -0
  161. package/dist/src/classes/components/Section.js +37 -0
  162. package/dist/src/classes/components/Section.js.map +1 -0
  163. package/dist/src/classes/components/Separator.d.ts +22 -0
  164. package/dist/src/classes/components/Separator.d.ts.map +1 -0
  165. package/dist/src/classes/components/Separator.js +33 -0
  166. package/dist/src/classes/components/Separator.js.map +1 -0
  167. package/dist/src/classes/components/StringSelectMenu.d.ts +15 -0
  168. package/dist/src/classes/components/StringSelectMenu.d.ts.map +1 -0
  169. package/dist/src/classes/components/StringSelectMenu.js +19 -0
  170. package/dist/src/classes/components/StringSelectMenu.js.map +1 -0
  171. package/dist/src/classes/components/TextDisplay.d.ts +10 -0
  172. package/dist/src/classes/components/TextDisplay.d.ts.map +1 -0
  173. package/dist/src/classes/components/TextDisplay.js +22 -0
  174. package/dist/src/classes/components/TextDisplay.js.map +1 -0
  175. package/dist/src/classes/components/TextInput.d.ts +53 -0
  176. package/dist/src/classes/components/TextInput.d.ts.map +1 -0
  177. package/dist/src/classes/components/TextInput.js +57 -0
  178. package/dist/src/classes/components/TextInput.js.map +1 -0
  179. package/dist/src/classes/components/Thumbnail.d.ts +14 -0
  180. package/dist/src/classes/components/Thumbnail.d.ts.map +1 -0
  181. package/dist/src/classes/components/Thumbnail.js +27 -0
  182. package/dist/src/classes/components/Thumbnail.js.map +1 -0
  183. package/dist/src/classes/components/UserSelectMenu.d.ts +15 -0
  184. package/dist/src/classes/components/UserSelectMenu.d.ts.map +1 -0
  185. package/dist/src/classes/components/UserSelectMenu.js +20 -0
  186. package/dist/src/classes/components/UserSelectMenu.js.map +1 -0
  187. package/dist/src/errors/BaseError.d.ts +3 -0
  188. package/dist/src/errors/BaseError.d.ts.map +1 -0
  189. package/dist/src/errors/BaseError.js +3 -0
  190. package/dist/src/errors/BaseError.js.map +1 -0
  191. package/dist/src/errors/DiscordError.d.ts +25 -0
  192. package/dist/src/errors/DiscordError.d.ts.map +1 -0
  193. package/dist/src/errors/DiscordError.js +31 -0
  194. package/dist/src/errors/DiscordError.js.map +1 -0
  195. package/dist/src/errors/RatelimitError.d.ts +15 -0
  196. package/dist/src/errors/RatelimitError.d.ts.map +1 -0
  197. package/dist/src/errors/RatelimitError.js +18 -0
  198. package/dist/src/errors/RatelimitError.js.map +1 -0
  199. package/dist/src/functions/channelFactory.d.ts +14 -0
  200. package/dist/src/functions/channelFactory.d.ts.map +1 -0
  201. package/dist/src/functions/channelFactory.js +39 -0
  202. package/dist/src/functions/channelFactory.js.map +1 -0
  203. package/dist/src/functions/enforceChoicesLimit.d.ts +3 -0
  204. package/dist/src/functions/enforceChoicesLimit.d.ts.map +1 -0
  205. package/dist/src/functions/enforceChoicesLimit.js +17 -0
  206. package/dist/src/functions/enforceChoicesLimit.js.map +1 -0
  207. package/dist/src/functions/errorsMapper.d.ts +14 -0
  208. package/dist/src/functions/errorsMapper.d.ts.map +1 -0
  209. package/dist/src/functions/errorsMapper.js +46 -0
  210. package/dist/src/functions/errorsMapper.js.map +1 -0
  211. package/dist/src/index.d.ts +93 -0
  212. package/dist/src/index.d.ts.map +1 -0
  213. package/dist/src/index.js +100 -0
  214. package/dist/src/index.js.map +1 -0
  215. package/dist/src/internals/AutocompleteInteraction.d.ts +43 -0
  216. package/dist/src/internals/AutocompleteInteraction.d.ts.map +1 -0
  217. package/dist/src/internals/AutocompleteInteraction.js +73 -0
  218. package/dist/src/internals/AutocompleteInteraction.js.map +1 -0
  219. package/dist/src/internals/ButtonInteraction.d.ts +8 -0
  220. package/dist/src/internals/ButtonInteraction.d.ts.map +1 -0
  221. package/dist/src/internals/ButtonInteraction.js +16 -0
  222. package/dist/src/internals/ButtonInteraction.js.map +1 -0
  223. package/dist/src/internals/ChannelSelectMenuInteraction.d.ts +8 -0
  224. package/dist/src/internals/ChannelSelectMenuInteraction.d.ts.map +1 -0
  225. package/dist/src/internals/ChannelSelectMenuInteraction.js +11 -0
  226. package/dist/src/internals/ChannelSelectMenuInteraction.js.map +1 -0
  227. package/dist/src/internals/CommandHandler.d.ts +13 -0
  228. package/dist/src/internals/CommandHandler.d.ts.map +1 -0
  229. package/dist/src/internals/CommandHandler.js +143 -0
  230. package/dist/src/internals/CommandHandler.js.map +1 -0
  231. package/dist/src/internals/CommandInteraction.d.ts +26 -0
  232. package/dist/src/internals/CommandInteraction.d.ts.map +1 -0
  233. package/dist/src/internals/CommandInteraction.js +60 -0
  234. package/dist/src/internals/CommandInteraction.js.map +1 -0
  235. package/dist/src/internals/ComponentHandler.d.ts +14 -0
  236. package/dist/src/internals/ComponentHandler.d.ts.map +1 -0
  237. package/dist/src/internals/ComponentHandler.js +183 -0
  238. package/dist/src/internals/ComponentHandler.js.map +1 -0
  239. package/dist/src/internals/EmojiHandler.d.ts +19 -0
  240. package/dist/src/internals/EmojiHandler.d.ts.map +1 -0
  241. package/dist/src/internals/EmojiHandler.js +34 -0
  242. package/dist/src/internals/EmojiHandler.js.map +1 -0
  243. package/dist/src/internals/EventHandler.d.ts +22 -0
  244. package/dist/src/internals/EventHandler.d.ts.map +1 -0
  245. package/dist/src/internals/EventHandler.js +23 -0
  246. package/dist/src/internals/EventHandler.js.map +1 -0
  247. package/dist/src/internals/EventQueue.d.ts +59 -0
  248. package/dist/src/internals/EventQueue.d.ts.map +1 -0
  249. package/dist/src/internals/EventQueue.js +131 -0
  250. package/dist/src/internals/EventQueue.js.map +1 -0
  251. package/dist/src/internals/FieldsHandler.d.ts +68 -0
  252. package/dist/src/internals/FieldsHandler.d.ts.map +1 -0
  253. package/dist/src/internals/FieldsHandler.js +146 -0
  254. package/dist/src/internals/FieldsHandler.js.map +1 -0
  255. package/dist/src/internals/MentionableSelectMenuInteraction.d.ts +9 -0
  256. package/dist/src/internals/MentionableSelectMenuInteraction.d.ts.map +1 -0
  257. package/dist/src/internals/MentionableSelectMenuInteraction.js +15 -0
  258. package/dist/src/internals/MentionableSelectMenuInteraction.js.map +1 -0
  259. package/dist/src/internals/ModalHandler.d.ts +17 -0
  260. package/dist/src/internals/ModalHandler.d.ts.map +1 -0
  261. package/dist/src/internals/ModalHandler.js +35 -0
  262. package/dist/src/internals/ModalHandler.js.map +1 -0
  263. package/dist/src/internals/ModalInteraction.d.ts +21 -0
  264. package/dist/src/internals/ModalInteraction.d.ts.map +1 -0
  265. package/dist/src/internals/ModalInteraction.js +41 -0
  266. package/dist/src/internals/ModalInteraction.js.map +1 -0
  267. package/dist/src/internals/OptionsHandler.d.ts +108 -0
  268. package/dist/src/internals/OptionsHandler.d.ts.map +1 -0
  269. package/dist/src/internals/OptionsHandler.js +237 -0
  270. package/dist/src/internals/OptionsHandler.js.map +1 -0
  271. package/dist/src/internals/RoleSelectMenuInteraction.d.ts +9 -0
  272. package/dist/src/internals/RoleSelectMenuInteraction.d.ts.map +1 -0
  273. package/dist/src/internals/RoleSelectMenuInteraction.js +14 -0
  274. package/dist/src/internals/RoleSelectMenuInteraction.js.map +1 -0
  275. package/dist/src/internals/StringSelectMenuInteraction.d.ts +9 -0
  276. package/dist/src/internals/StringSelectMenuInteraction.d.ts.map +1 -0
  277. package/dist/src/internals/StringSelectMenuInteraction.js +14 -0
  278. package/dist/src/internals/StringSelectMenuInteraction.js.map +1 -0
  279. package/dist/src/internals/TemporaryListenerManager.d.ts +20 -0
  280. package/dist/src/internals/TemporaryListenerManager.d.ts.map +1 -0
  281. package/dist/src/internals/TemporaryListenerManager.js +59 -0
  282. package/dist/src/internals/TemporaryListenerManager.js.map +1 -0
  283. package/dist/src/internals/UserSelectMenuInteraction.d.ts +9 -0
  284. package/dist/src/internals/UserSelectMenuInteraction.d.ts.map +1 -0
  285. package/dist/src/internals/UserSelectMenuInteraction.js +14 -0
  286. package/dist/src/internals/UserSelectMenuInteraction.js.map +1 -0
  287. package/dist/src/permissions.d.ts +56 -0
  288. package/dist/src/permissions.d.ts.map +1 -0
  289. package/dist/src/permissions.js +4 -0
  290. package/dist/src/permissions.js.map +1 -0
  291. package/dist/src/plugins/client-manager/ClientManager.d.ts +151 -0
  292. package/dist/src/plugins/client-manager/ClientManager.d.ts.map +1 -0
  293. package/dist/src/plugins/client-manager/ClientManager.js +253 -0
  294. package/dist/src/plugins/client-manager/ClientManager.js.map +1 -0
  295. package/dist/src/plugins/client-manager/index.d.ts +2 -0
  296. package/dist/src/plugins/client-manager/index.d.ts.map +1 -0
  297. package/dist/src/plugins/client-manager/index.js +2 -0
  298. package/dist/src/plugins/client-manager/index.js.map +1 -0
  299. package/dist/src/plugins/command-data/CommandDataPlugin.d.ts +16 -0
  300. package/dist/src/plugins/command-data/CommandDataPlugin.d.ts.map +1 -0
  301. package/dist/src/plugins/command-data/CommandDataPlugin.js +43 -0
  302. package/dist/src/plugins/command-data/CommandDataPlugin.js.map +1 -0
  303. package/dist/src/plugins/command-data/index.d.ts +2 -0
  304. package/dist/src/plugins/command-data/index.d.ts.map +1 -0
  305. package/dist/src/plugins/command-data/index.js +2 -0
  306. package/dist/src/plugins/command-data/index.js.map +1 -0
  307. package/dist/src/plugins/gateway/BabyCache.d.ts +16 -0
  308. package/dist/src/plugins/gateway/BabyCache.d.ts.map +1 -0
  309. package/dist/src/plugins/gateway/BabyCache.js +53 -0
  310. package/dist/src/plugins/gateway/BabyCache.js.map +1 -0
  311. package/dist/src/plugins/gateway/GatewayPlugin.d.ts +90 -0
  312. package/dist/src/plugins/gateway/GatewayPlugin.d.ts.map +1 -0
  313. package/dist/src/plugins/gateway/GatewayPlugin.js +516 -0
  314. package/dist/src/plugins/gateway/GatewayPlugin.js.map +1 -0
  315. package/dist/src/plugins/gateway/InteractionEventListener.d.ts +8 -0
  316. package/dist/src/plugins/gateway/InteractionEventListener.d.ts.map +1 -0
  317. package/dist/src/plugins/gateway/InteractionEventListener.js +9 -0
  318. package/dist/src/plugins/gateway/InteractionEventListener.js.map +1 -0
  319. package/dist/src/plugins/gateway/index.d.ts +7 -0
  320. package/dist/src/plugins/gateway/index.d.ts.map +1 -0
  321. package/dist/src/plugins/gateway/index.js +7 -0
  322. package/dist/src/plugins/gateway/index.js.map +1 -0
  323. package/dist/src/plugins/gateway/types.d.ts +130 -0
  324. package/dist/src/plugins/gateway/types.d.ts.map +1 -0
  325. package/dist/src/plugins/gateway/types.js +5 -0
  326. package/dist/src/plugins/gateway/types.js.map +1 -0
  327. package/dist/src/plugins/gateway/utils/heartbeat.d.ts +18 -0
  328. package/dist/src/plugins/gateway/utils/heartbeat.d.ts.map +1 -0
  329. package/dist/src/plugins/gateway/utils/heartbeat.js +33 -0
  330. package/dist/src/plugins/gateway/utils/heartbeat.js.map +1 -0
  331. package/dist/src/plugins/gateway/utils/monitor.d.ts +37 -0
  332. package/dist/src/plugins/gateway/utils/monitor.d.ts.map +1 -0
  333. package/dist/src/plugins/gateway/utils/monitor.js +88 -0
  334. package/dist/src/plugins/gateway/utils/monitor.js.map +1 -0
  335. package/dist/src/plugins/gateway/utils/payload.d.ts +24 -0
  336. package/dist/src/plugins/gateway/utils/payload.d.ts.map +1 -0
  337. package/dist/src/plugins/gateway/utils/payload.js +65 -0
  338. package/dist/src/plugins/gateway/utils/payload.js.map +1 -0
  339. package/dist/src/plugins/gateway/utils/rateLimit.d.ts +41 -0
  340. package/dist/src/plugins/gateway/utils/rateLimit.d.ts.map +1 -0
  341. package/dist/src/plugins/gateway/utils/rateLimit.js +61 -0
  342. package/dist/src/plugins/gateway/utils/rateLimit.js.map +1 -0
  343. package/dist/src/plugins/gateway-forwarder/GatewayForwarderPlugin.d.ts +30 -0
  344. package/dist/src/plugins/gateway-forwarder/GatewayForwarderPlugin.d.ts.map +1 -0
  345. package/dist/src/plugins/gateway-forwarder/GatewayForwarderPlugin.js +80 -0
  346. package/dist/src/plugins/gateway-forwarder/GatewayForwarderPlugin.js.map +1 -0
  347. package/dist/src/plugins/gateway-forwarder/ShardedGatewayForwarderPlugin.d.ts +9 -0
  348. package/dist/src/plugins/gateway-forwarder/ShardedGatewayForwarderPlugin.d.ts.map +1 -0
  349. package/dist/src/plugins/gateway-forwarder/ShardedGatewayForwarderPlugin.js +7 -0
  350. package/dist/src/plugins/gateway-forwarder/ShardedGatewayForwarderPlugin.js.map +1 -0
  351. package/dist/src/plugins/gateway-forwarder/index.d.ts +4 -0
  352. package/dist/src/plugins/gateway-forwarder/index.d.ts.map +1 -0
  353. package/dist/src/plugins/gateway-forwarder/index.js +4 -0
  354. package/dist/src/plugins/gateway-forwarder/index.js.map +1 -0
  355. package/dist/src/plugins/linked-roles/LinkedRoles.d.ts +70 -0
  356. package/dist/src/plugins/linked-roles/LinkedRoles.d.ts.map +1 -0
  357. package/dist/src/plugins/linked-roles/LinkedRoles.js +211 -0
  358. package/dist/src/plugins/linked-roles/LinkedRoles.js.map +1 -0
  359. package/dist/src/plugins/linked-roles/index.d.ts +3 -0
  360. package/dist/src/plugins/linked-roles/index.d.ts.map +1 -0
  361. package/dist/src/plugins/linked-roles/index.js +3 -0
  362. package/dist/src/plugins/linked-roles/index.js.map +1 -0
  363. package/dist/src/plugins/linked-roles/types.d.ts +94 -0
  364. package/dist/src/plugins/linked-roles/types.d.ts.map +1 -0
  365. package/dist/src/plugins/linked-roles/types.js +39 -0
  366. package/dist/src/plugins/linked-roles/types.js.map +1 -0
  367. package/dist/src/plugins/paginator/GoToPageModal.d.ts +18 -0
  368. package/dist/src/plugins/paginator/GoToPageModal.d.ts.map +1 -0
  369. package/dist/src/plugins/paginator/GoToPageModal.js +56 -0
  370. package/dist/src/plugins/paginator/GoToPageModal.js.map +1 -0
  371. package/dist/src/plugins/paginator/Paginator.d.ts +53 -0
  372. package/dist/src/plugins/paginator/Paginator.d.ts.map +1 -0
  373. package/dist/src/plugins/paginator/Paginator.js +183 -0
  374. package/dist/src/plugins/paginator/Paginator.js.map +1 -0
  375. package/dist/src/plugins/paginator/index.d.ts +11 -0
  376. package/dist/src/plugins/paginator/index.d.ts.map +1 -0
  377. package/dist/src/plugins/paginator/index.js +11 -0
  378. package/dist/src/plugins/paginator/index.js.map +1 -0
  379. package/dist/src/plugins/sharding/ShardingPlugin.d.ts +44 -0
  380. package/dist/src/plugins/sharding/ShardingPlugin.d.ts.map +1 -0
  381. package/dist/src/plugins/sharding/ShardingPlugin.js +119 -0
  382. package/dist/src/plugins/sharding/ShardingPlugin.js.map +1 -0
  383. package/dist/src/plugins/sharding/index.d.ts +3 -0
  384. package/dist/src/plugins/sharding/index.d.ts.map +1 -0
  385. package/dist/src/plugins/sharding/index.js +3 -0
  386. package/dist/src/plugins/sharding/index.js.map +1 -0
  387. package/dist/src/plugins/voice/GuildDeleteListener.d.ts +7 -0
  388. package/dist/src/plugins/voice/GuildDeleteListener.d.ts.map +1 -0
  389. package/dist/src/plugins/voice/GuildDeleteListener.js +11 -0
  390. package/dist/src/plugins/voice/GuildDeleteListener.js.map +1 -0
  391. package/dist/src/plugins/voice/VoicePlugin.d.ts +15 -0
  392. package/dist/src/plugins/voice/VoicePlugin.d.ts.map +1 -0
  393. package/dist/src/plugins/voice/VoicePlugin.js +58 -0
  394. package/dist/src/plugins/voice/VoicePlugin.js.map +1 -0
  395. package/dist/src/plugins/voice/VoiceServerUpdateListener.d.ts +10 -0
  396. package/dist/src/plugins/voice/VoiceServerUpdateListener.d.ts.map +1 -0
  397. package/dist/src/plugins/voice/VoiceServerUpdateListener.js +16 -0
  398. package/dist/src/plugins/voice/VoiceServerUpdateListener.js.map +1 -0
  399. package/dist/src/plugins/voice/VoiceStateUpdateListener.d.ts +10 -0
  400. package/dist/src/plugins/voice/VoiceStateUpdateListener.d.ts.map +1 -0
  401. package/dist/src/plugins/voice/VoiceStateUpdateListener.js +21 -0
  402. package/dist/src/plugins/voice/VoiceStateUpdateListener.js.map +1 -0
  403. package/dist/src/plugins/voice/index.d.ts +2 -0
  404. package/dist/src/plugins/voice/index.d.ts.map +1 -0
  405. package/dist/src/plugins/voice/index.js +2 -0
  406. package/dist/src/plugins/voice/index.js.map +1 -0
  407. package/dist/src/structures/DmChannel.d.ts +22 -0
  408. package/dist/src/structures/DmChannel.d.ts.map +1 -0
  409. package/dist/src/structures/DmChannel.js +33 -0
  410. package/dist/src/structures/DmChannel.js.map +1 -0
  411. package/dist/src/structures/Emoji.d.ts +75 -0
  412. package/dist/src/structures/Emoji.d.ts.map +1 -0
  413. package/dist/src/structures/Emoji.js +156 -0
  414. package/dist/src/structures/Emoji.js.map +1 -0
  415. package/dist/src/structures/GroupDmChannel.d.ts +75 -0
  416. package/dist/src/structures/GroupDmChannel.d.ts.map +1 -0
  417. package/dist/src/structures/GroupDmChannel.js +131 -0
  418. package/dist/src/structures/GroupDmChannel.js.map +1 -0
  419. package/dist/src/structures/Guild.d.ts +338 -0
  420. package/dist/src/structures/Guild.d.ts.map +1 -0
  421. package/dist/src/structures/Guild.js +715 -0
  422. package/dist/src/structures/Guild.js.map +1 -0
  423. package/dist/src/structures/GuildAnnouncementChannel.d.ts +21 -0
  424. package/dist/src/structures/GuildAnnouncementChannel.d.ts.map +1 -0
  425. package/dist/src/structures/GuildAnnouncementChannel.js +35 -0
  426. package/dist/src/structures/GuildAnnouncementChannel.js.map +1 -0
  427. package/dist/src/structures/GuildCategoryChannel.d.ts +23 -0
  428. package/dist/src/structures/GuildCategoryChannel.d.ts.map +1 -0
  429. package/dist/src/structures/GuildCategoryChannel.js +34 -0
  430. package/dist/src/structures/GuildCategoryChannel.js.map +1 -0
  431. package/dist/src/structures/GuildForumChannel.d.ts +14 -0
  432. package/dist/src/structures/GuildForumChannel.d.ts.map +1 -0
  433. package/dist/src/structures/GuildForumChannel.js +15 -0
  434. package/dist/src/structures/GuildForumChannel.js.map +1 -0
  435. package/dist/src/structures/GuildMediaChannel.d.ts +9 -0
  436. package/dist/src/structures/GuildMediaChannel.d.ts.map +1 -0
  437. package/dist/src/structures/GuildMediaChannel.js +7 -0
  438. package/dist/src/structures/GuildMediaChannel.js.map +1 -0
  439. package/dist/src/structures/GuildMember.d.ts +145 -0
  440. package/dist/src/structures/GuildMember.d.ts.map +1 -0
  441. package/dist/src/structures/GuildMember.js +320 -0
  442. package/dist/src/structures/GuildMember.js.map +1 -0
  443. package/dist/src/structures/GuildScheduledEvent.d.ts +121 -0
  444. package/dist/src/structures/GuildScheduledEvent.d.ts.map +1 -0
  445. package/dist/src/structures/GuildScheduledEvent.js +228 -0
  446. package/dist/src/structures/GuildScheduledEvent.js.map +1 -0
  447. package/dist/src/structures/GuildStageOrVoiceChannel.d.ts +40 -0
  448. package/dist/src/structures/GuildStageOrVoiceChannel.d.ts.map +1 -0
  449. package/dist/src/structures/GuildStageOrVoiceChannel.js +63 -0
  450. package/dist/src/structures/GuildStageOrVoiceChannel.js.map +1 -0
  451. package/dist/src/structures/GuildTextChannel.d.ts +24 -0
  452. package/dist/src/structures/GuildTextChannel.d.ts.map +1 -0
  453. package/dist/src/structures/GuildTextChannel.js +41 -0
  454. package/dist/src/structures/GuildTextChannel.js.map +1 -0
  455. package/dist/src/structures/GuildThreadChannel.d.ts +90 -0
  456. package/dist/src/structures/GuildThreadChannel.d.ts.map +1 -0
  457. package/dist/src/structures/GuildThreadChannel.js +165 -0
  458. package/dist/src/structures/GuildThreadChannel.js.map +1 -0
  459. package/dist/src/structures/Message.d.ts +174 -0
  460. package/dist/src/structures/Message.d.ts.map +1 -0
  461. package/dist/src/structures/Message.js +417 -0
  462. package/dist/src/structures/Message.js.map +1 -0
  463. package/dist/src/structures/Poll.d.ts +29 -0
  464. package/dist/src/structures/Poll.d.ts.map +1 -0
  465. package/dist/src/structures/Poll.js +51 -0
  466. package/dist/src/structures/Poll.js.map +1 -0
  467. package/dist/src/structures/Role.d.ts +151 -0
  468. package/dist/src/structures/Role.d.ts.map +1 -0
  469. package/dist/src/structures/Role.js +291 -0
  470. package/dist/src/structures/Role.js.map +1 -0
  471. package/dist/src/structures/ThreadMember.d.ts +40 -0
  472. package/dist/src/structures/ThreadMember.d.ts.map +1 -0
  473. package/dist/src/structures/ThreadMember.js +79 -0
  474. package/dist/src/structures/ThreadMember.js.map +1 -0
  475. package/dist/src/structures/User.d.ts +104 -0
  476. package/dist/src/structures/User.d.ts.map +1 -0
  477. package/dist/src/structures/User.js +199 -0
  478. package/dist/src/structures/User.js.map +1 -0
  479. package/dist/src/structures/Webhook.d.ts +160 -0
  480. package/dist/src/structures/Webhook.d.ts.map +1 -0
  481. package/dist/src/structures/Webhook.js +287 -0
  482. package/dist/src/structures/Webhook.js.map +1 -0
  483. package/dist/src/types/index.d.ts +199 -0
  484. package/dist/src/types/index.d.ts.map +1 -0
  485. package/dist/src/types/index.js +2 -0
  486. package/dist/src/types/index.js.map +1 -0
  487. package/dist/src/types/listeners.d.ts +579 -0
  488. package/dist/src/types/listeners.d.ts.map +1 -0
  489. package/dist/src/types/listeners.js +14 -0
  490. package/dist/src/types/listeners.js.map +1 -0
  491. package/dist/src/utils/LRUCache.d.ts +46 -0
  492. package/dist/src/utils/LRUCache.d.ts.map +1 -0
  493. package/dist/src/utils/LRUCache.js +78 -0
  494. package/dist/src/utils/LRUCache.js.map +1 -0
  495. package/dist/src/utils/cdn.d.ts +31 -0
  496. package/dist/src/utils/cdn.d.ts.map +1 -0
  497. package/dist/src/utils/cdn.js +18 -0
  498. package/dist/src/utils/cdn.js.map +1 -0
  499. package/dist/src/utils/customIdParser.d.ts +3 -0
  500. package/dist/src/utils/customIdParser.d.ts.map +1 -0
  501. package/dist/src/utils/customIdParser.js +38 -0
  502. package/dist/src/utils/customIdParser.js.map +1 -0
  503. package/dist/src/utils/index.d.ts +6 -0
  504. package/dist/src/utils/index.d.ts.map +1 -0
  505. package/dist/src/utils/index.js +6 -0
  506. package/dist/src/utils/index.js.map +1 -0
  507. package/dist/src/utils/payload.d.ts +4 -0
  508. package/dist/src/utils/payload.d.ts.map +1 -0
  509. package/dist/src/utils/payload.js +61 -0
  510. package/dist/src/utils/payload.js.map +1 -0
  511. package/dist/src/utils/proxy.d.ts +27 -0
  512. package/dist/src/utils/proxy.d.ts.map +1 -0
  513. package/dist/src/utils/proxy.js +135 -0
  514. package/dist/src/utils/proxy.js.map +1 -0
  515. package/dist/src/utils/verification.d.ts +4 -0
  516. package/dist/src/utils/verification.d.ts.map +1 -0
  517. package/dist/src/utils/verification.js +52 -0
  518. package/dist/src/utils/verification.js.map +1 -0
  519. package/dist/tsconfig.tsbuildinfo +1 -0
  520. package/package.json +43 -0
@@ -0,0 +1,89 @@
1
+ import { Routes } from "discord-api-types/v10";
2
+ import { GuildThreadChannel } from "../structures/GuildThreadChannel.js";
3
+ import { Message } from "../structures/Message.js";
4
+ import { BaseGuildChannel } from "./BaseGuildChannel.js";
5
+ export class BaseGuildTextChannel extends BaseGuildChannel {
6
+ /**
7
+ * The topic of the channel.
8
+ */
9
+ get topic() {
10
+ if (!this.rawData)
11
+ return undefined;
12
+ return this.rawData.topic ?? null;
13
+ }
14
+ /**
15
+ * The ID of the last message sent in the channel.
16
+ *
17
+ * @remarks
18
+ * This might not always resolve to a message. The ID still stays a part of the channel's data, even if the message is deleted.
19
+ */
20
+ get lastMessageId() {
21
+ if (!this.rawData)
22
+ return undefined;
23
+ return this.rawData.last_message_id ?? null;
24
+ }
25
+ /**
26
+ * The timestamp of the last pin in the channel.
27
+ */
28
+ get lastPinTimestamp() {
29
+ if (!this.rawData)
30
+ return undefined;
31
+ return this.rawData.last_pin_timestamp ?? null;
32
+ }
33
+ /**
34
+ * The rate limit per user for the channel, in seconds.
35
+ */
36
+ get rateLimitPerUser() {
37
+ if (!this.rawData)
38
+ return undefined;
39
+ return this.rawData.rate_limit_per_user;
40
+ }
41
+ /**
42
+ * The last message sent in the channel.
43
+ *
44
+ * @remarks
45
+ * This might not always resolve to a message. The ID still stays a part of the channel's data, even if the message is deleted.
46
+ * This will always return a partial message, so you can use {@link Message.fetch} to get the full message data.
47
+ *
48
+ */
49
+ get lastMessage() {
50
+ if (!this.rawData)
51
+ return undefined;
52
+ if (!this.lastMessageId)
53
+ return null;
54
+ return new Message(this.client, {
55
+ id: this.lastMessageId,
56
+ channelId: this.id
57
+ });
58
+ }
59
+ /**
60
+ * Get the pinned messages in the channel using paginated API
61
+ * @param options Optional pagination parameters
62
+ */
63
+ async getChannelPins(options) {
64
+ const queryParams = {};
65
+ if (options?.before)
66
+ queryParams.before = options.before;
67
+ if (options?.limit)
68
+ queryParams.limit = options.limit.toString();
69
+ const result = (await this.client.rest.get(Routes.channelMessagesPins(this.id), Object.keys(queryParams).length > 0 ? queryParams : undefined));
70
+ return {
71
+ pins: result.items.map((pin) => ({
72
+ pinnedAt: pin.pinned_at,
73
+ message: new Message(this.client, pin.message)
74
+ })),
75
+ hasMore: result.has_more
76
+ };
77
+ }
78
+ /**
79
+ * Start a thread without an associated start message.
80
+ * If you want to start a thread with a start message, use {@link Message.startThread}
81
+ */
82
+ async startThread(data) {
83
+ const thread = (await this.client.rest.post(Routes.threads(this.id), {
84
+ body: { ...data }
85
+ }));
86
+ return new GuildThreadChannel(this.client, thread);
87
+ }
88
+ }
89
+ //# sourceMappingURL=BaseGuildTextChannel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseGuildTextChannel.js","sourceRoot":"","sources":["../../../src/abstracts/BaseGuildTextChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAON,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,MAAM,OAAgB,oBAGpB,SAAQ,gBAAiC;IAG1C;;OAEG;IACH,IAAI,KAAK;QACR,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAkB,CAAA;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAA;IAClC,CAAC;IAED;;;;;OAKG;IACH,IAAI,aAAa;QAChB,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAkB,CAAA;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,IAAI,IAAI,CAAA;IAC5C,CAAC;IACD;;OAEG;IACH,IAAI,gBAAgB;QACnB,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAkB,CAAA;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,kBAAkB,IAAI,IAAI,CAAA;IA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,CAAC,OAAO,CAAC;aAC9C,CAAC,CAAC;YACH,OAAO,EAAE,MAAM,CAAC,QAAQ;SACxB,CAAA;IACF,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,WAAW,CAAC,IAAuC;QACxD,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YACpE,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE;SACjB,CAAC,CAAqB,CAAA;QACvB,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACnD,CAAC;CACD"}
@@ -0,0 +1,166 @@
1
+ import { type APIInteraction, type InteractionType } from "discord-api-types/v10";
2
+ import { type Client, Embed, Guild, Message, type Modal, User } from "../index.js";
3
+ import { GuildMember } from "../structures/GuildMember.js";
4
+ import type { MessagePayload } from "../types/index.js";
5
+ import { Base } from "./Base.js";
6
+ export type InteractionDefaults = {
7
+ ephemeral?: boolean;
8
+ };
9
+ /**
10
+ * This is the base type interaction, all interaction types extend from this
11
+ */
12
+ export declare abstract class BaseInteraction<T extends APIInteraction> extends Base {
13
+ /**
14
+ * The type of interaction
15
+ */
16
+ type: InteractionType;
17
+ /**
18
+ * The internal raw data of the interaction
19
+ */
20
+ protected _rawData: T;
21
+ /**
22
+ * The raw Discord API data for this interaction
23
+ */
24
+ get rawData(): Readonly<T>;
25
+ /**
26
+ * The user who sent the interaction
27
+ */
28
+ userId: string | undefined;
29
+ /**
30
+ * Whether the interaction is deferred already
31
+ * @internal
32
+ */
33
+ _deferred: boolean;
34
+ private defaultEphemeral;
35
+ constructor(client: Client, data: T, defaults: InteractionDefaults);
36
+ get embeds(): Embed[] | null;
37
+ get message(): Message | null;
38
+ get guild(): Guild<true> | null;
39
+ get user(): User | null;
40
+ get channel(): import("../index.js").DmChannel<false> | import("../index.js").GroupDmChannel<false> | import("../index.js").GuildTextChannel<false> | import("../index.js").GuildVoiceChannel<false> | import("../index.js").GuildCategoryChannel<false> | import("../index.js").GuildAnnouncementChannel<false> | import("../index.js").GuildThreadChannel<import("discord-api-types/v10").ChannelType.AnnouncementThread | import("discord-api-types/v10").ChannelType.PublicThread | import("discord-api-types/v10").ChannelType.PrivateThread, false> | import("../index.js").GuildStageChannel<false> | import("../index.js").GuildForumChannel<false> | import("../index.js").GuildMediaChannel | null;
41
+ get member(): GuildMember<false, true> | null;
42
+ /**
43
+ * @internal
44
+ * Automatically register components found in a message payload when sending the message.
45
+ */
46
+ protected _internalAutoRegisterComponentsOnSend(data: MessagePayload): void;
47
+ /**
48
+ * @internal
49
+ * Register components found in a message payload when sending the message.
50
+ */
51
+ private _internalRegisterComponentsOnSend;
52
+ /**
53
+ * Reply to an interaction.
54
+ * If the interaction is deferred, this will edit the original response.
55
+ * @param data The message data to send
56
+ */
57
+ reply(data: MessagePayload, overrideAutoRegister?: boolean): Promise<Message<false>>;
58
+ /**
59
+ * Set the default ephemeral value for this interaction
60
+ * @internal
61
+ */
62
+ setDefaultEphemeral(ephemeral: boolean): void;
63
+ /**
64
+ * Defer the interaction response. This is used automatically by commands that are set to defer.
65
+ * If the interaction is already deferred, this will do nothing.
66
+ * @internal
67
+ */
68
+ defer({ ephemeral }?: {
69
+ ephemeral?: boolean | undefined;
70
+ }): Promise<void>;
71
+ /**
72
+ * Show a modal to the user
73
+ * This can only be used if the interaction is not deferred
74
+ */
75
+ showModal(modal: Modal): Promise<void>;
76
+ /**
77
+ * Send a followup message to the interaction
78
+ */
79
+ followUp(reply: MessagePayload): Promise<void>;
80
+ /**
81
+ * This function will reply to the interaction and wait for a component to be pressed.
82
+ * Any components passed in the message will not have run() functions called and
83
+ * will only trigger the interaction.acknowledge() function.
84
+ * This function will also return a promise that resolves
85
+ * to the custom ID of the component that was pressed.
86
+ *
87
+ * @param data The message data to send
88
+ * @param timeout After this many milliseconds, the promise will resolve to null
89
+ */
90
+ replyAndWaitForComponent(data: MessagePayload, timeout?: number): Promise<{
91
+ /**
92
+ * Whether the interaction was successful
93
+ */
94
+ success: true;
95
+ /**
96
+ * The custom ID of the component that was pressed
97
+ */
98
+ customId: string;
99
+ /**
100
+ * The message object returned by the interaction reply
101
+ */
102
+ message: Message<false>;
103
+ /**
104
+ * If this is a select menu, this will be the values of the selected options
105
+ */
106
+ values?: string[];
107
+ } | {
108
+ /**
109
+ * Whether the interaction was successful
110
+ */
111
+ success: false;
112
+ /**
113
+ * The message object returned by the interaction reply
114
+ */
115
+ message: Message<false>;
116
+ /**
117
+ * The reason the interaction failed
118
+ */
119
+ reason: "timed out";
120
+ }>;
121
+ /**
122
+ * This function will edit to the interaction and wait for a component to be pressed.
123
+ * Any components passed in the message will not have run() functions called and
124
+ * will only trigger the interaction.acknowledge() function.
125
+ * This function will also return a promise that resolves
126
+ * to the custom ID of the component that was pressed.
127
+ *
128
+ * @param data The message data to send
129
+ * @param message The message to edit (defaults to the interaction's original message)
130
+ * @param {number} [timeout=300000] After this many milliseconds, the promise will resolve to null
131
+ *
132
+ * @returns Will return null if the interaction has not yet been replied to or if the message provided no longer exists
133
+ */
134
+ editAndWaitForComponent(data: MessagePayload, message?: Message, timeout?: number): Promise<{
135
+ /**
136
+ * Whether the interaction was successful
137
+ */
138
+ success: true;
139
+ /**
140
+ * The custom ID of the component that was pressed
141
+ */
142
+ customId: string;
143
+ /**
144
+ * The message object returned by the interaction reply
145
+ */
146
+ message: Message<false>;
147
+ /**
148
+ * If this is a select menu, this will be the values of the selected options
149
+ */
150
+ values?: string[];
151
+ } | {
152
+ /**
153
+ * Whether the interaction was successful
154
+ */
155
+ success: false;
156
+ /**
157
+ * The message object returned by the interaction reply
158
+ */
159
+ message: Message<false>;
160
+ /**
161
+ * The reason the interaction failed
162
+ */
163
+ reason: "timed out";
164
+ } | null>;
165
+ }
166
+ //# sourceMappingURL=BaseInteraction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseInteraction.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AO,CAAC,KAAK,CAAC,CAAA;QACvB;;WAEG;QACH,MAAM,EAAE,WAAW,CAAA;KAClB,GACD,IAAI,CACN;CA4BD"}
@@ -0,0 +1,274 @@
1
+ import { InteractionResponseType, MessageFlags, Routes } from "discord-api-types/v10";
2
+ import { BaseMessageInteractiveComponent, Container, channelFactory, Embed, Guild, Message, Row, Section, User } from "../index.js";
3
+ import { GuildMember } from "../structures/GuildMember.js";
4
+ import { serializePayload } from "../utils/index.js";
5
+ import { Base } from "./Base.js";
6
+ /**
7
+ * This is the base type interaction, all interaction types extend from this
8
+ */
9
+ export class BaseInteraction extends Base {
10
+ /**
11
+ * The type of interaction
12
+ */
13
+ type;
14
+ /**
15
+ * The internal raw data of the interaction
16
+ */
17
+ _rawData;
18
+ /**
19
+ * The raw Discord API data for this interaction
20
+ */
21
+ get rawData() {
22
+ return this._rawData;
23
+ }
24
+ /**
25
+ * The user who sent the interaction
26
+ */
27
+ userId;
28
+ /**
29
+ * Whether the interaction is deferred already
30
+ * @internal
31
+ */
32
+ _deferred = false;
33
+ defaultEphemeral = false;
34
+ constructor(client, data, defaults) {
35
+ super(client);
36
+ this._rawData = data;
37
+ this.type = data.type;
38
+ this.userId =
39
+ this._rawData.user?.id || this._rawData.member?.user.id || undefined;
40
+ if (defaults.ephemeral)
41
+ this.defaultEphemeral = defaults.ephemeral;
42
+ }
43
+ get embeds() {
44
+ if (!this._rawData.message)
45
+ return null;
46
+ return this._rawData.message.embeds.map((embed) => new Embed(embed));
47
+ }
48
+ get message() {
49
+ if (!this._rawData.message)
50
+ return null;
51
+ return new Message(this.client, this._rawData.message);
52
+ }
53
+ get guild() {
54
+ if (!this._rawData.guild_id)
55
+ return null;
56
+ return new Guild(this.client, this._rawData.guild_id);
57
+ }
58
+ get user() {
59
+ if (this._rawData.user)
60
+ return new User(this.client, this._rawData.user);
61
+ if (this._rawData.member)
62
+ return new User(this.client, this._rawData.member.user);
63
+ return null;
64
+ }
65
+ get channel() {
66
+ if (!this._rawData.channel)
67
+ return null;
68
+ return channelFactory(this.client, this._rawData.channel);
69
+ }
70
+ get member() {
71
+ if (!this._rawData.member)
72
+ return null;
73
+ if (!this.guild)
74
+ return null;
75
+ return new GuildMember(this.client, this._rawData.member, this.guild);
76
+ }
77
+ /**
78
+ * @internal
79
+ * Automatically register components found in a message payload when sending the message.
80
+ */
81
+ _internalAutoRegisterComponentsOnSend(data) {
82
+ if (typeof data !== "string" && data.components) {
83
+ this._internalRegisterComponentsOnSend(data.components);
84
+ }
85
+ }
86
+ /**
87
+ * @internal
88
+ * Register components found in a message payload when sending the message.
89
+ */
90
+ _internalRegisterComponentsOnSend(components) {
91
+ for (const component of components) {
92
+ if (component instanceof Row) {
93
+ for (const childComponent of component.components) {
94
+ if (childComponent instanceof BaseMessageInteractiveComponent) {
95
+ const key = childComponent.customIdParser(childComponent.customId).key;
96
+ if (!this.client.componentHandler.hasComponentWithKey(key)) {
97
+ this.client.componentHandler.registerComponent(childComponent);
98
+ }
99
+ }
100
+ }
101
+ }
102
+ else if (component instanceof Section) {
103
+ if (component.accessory instanceof BaseMessageInteractiveComponent) {
104
+ const key = component.accessory.customIdParser(component.accessory.customId).key;
105
+ if (!this.client.componentHandler.hasComponentWithKey(key)) {
106
+ this.client.componentHandler.registerComponent(component.accessory);
107
+ }
108
+ }
109
+ }
110
+ else if (component instanceof Container) {
111
+ this._internalRegisterComponentsOnSend(component.components);
112
+ }
113
+ }
114
+ }
115
+ /**
116
+ * Reply to an interaction.
117
+ * If the interaction is deferred, this will edit the original response.
118
+ * @param data The message data to send
119
+ */
120
+ async reply(data, overrideAutoRegister = false) {
121
+ const serialized = serializePayload(data, this.defaultEphemeral);
122
+ // Auto-register any components in the message
123
+ if (!overrideAutoRegister)
124
+ this._internalAutoRegisterComponentsOnSend(data);
125
+ if (this._deferred) {
126
+ const message = (await this.client.rest.patch(Routes.webhookMessage(this.client.options.clientId, this._rawData.token, "@original"), {
127
+ body: serialized
128
+ }));
129
+ return new Message(this.client, message);
130
+ }
131
+ const done = (await this.client.rest.post(Routes.interactionCallback(this._rawData.id, this._rawData.token), {
132
+ body: {
133
+ type: InteractionResponseType.ChannelMessageWithSource,
134
+ data: serialized
135
+ }
136
+ }, {
137
+ with_response: true
138
+ }));
139
+ if (!done.resource?.message)
140
+ throw new Error(`No resource returned for message from interaction callback: ${done.resource}`);
141
+ return new Message(this.client, done.resource.message);
142
+ }
143
+ /**
144
+ * Set the default ephemeral value for this interaction
145
+ * @internal
146
+ */
147
+ setDefaultEphemeral(ephemeral) {
148
+ this.defaultEphemeral = ephemeral;
149
+ }
150
+ /**
151
+ * Defer the interaction response. This is used automatically by commands that are set to defer.
152
+ * If the interaction is already deferred, this will do nothing.
153
+ * @internal
154
+ */
155
+ async defer({ ephemeral = false } = {}) {
156
+ if (this._deferred)
157
+ return;
158
+ this._deferred = true;
159
+ await this.client.rest.post(Routes.interactionCallback(this._rawData.id, this._rawData.token), {
160
+ body: {
161
+ type: InteractionResponseType.DeferredChannelMessageWithSource,
162
+ data: {
163
+ flags: ephemeral || this.defaultEphemeral
164
+ ? MessageFlags.Ephemeral
165
+ : undefined
166
+ }
167
+ }
168
+ });
169
+ }
170
+ /**
171
+ * Show a modal to the user
172
+ * This can only be used if the interaction is not deferred
173
+ */
174
+ async showModal(modal) {
175
+ if (this._deferred)
176
+ throw new Error("You cannot defer an interaction that shows a modal");
177
+ const key = modal.customIdParser(modal.customId).key;
178
+ const existingModal = this.client.modalHandler.modals.find((m) => m.customIdParser(m.customId).key === key);
179
+ if (!existingModal) {
180
+ this.client.modalHandler.registerModal(modal);
181
+ }
182
+ await this.client.rest.post(Routes.interactionCallback(this._rawData.id, this._rawData.token), {
183
+ body: {
184
+ type: InteractionResponseType.Modal,
185
+ data: modal.serialize()
186
+ }
187
+ });
188
+ }
189
+ /**
190
+ * Send a followup message to the interaction
191
+ */
192
+ async followUp(reply) {
193
+ const serialized = serializePayload(reply);
194
+ // Auto-register any components in the message
195
+ this._internalAutoRegisterComponentsOnSend(reply);
196
+ await this.client.rest.post(Routes.webhook(this.client.options.clientId, this._rawData.token), {
197
+ body: {
198
+ ...serialized
199
+ }
200
+ });
201
+ }
202
+ /**
203
+ * This function will reply to the interaction and wait for a component to be pressed.
204
+ * Any components passed in the message will not have run() functions called and
205
+ * will only trigger the interaction.acknowledge() function.
206
+ * This function will also return a promise that resolves
207
+ * to the custom ID of the component that was pressed.
208
+ *
209
+ * @param data The message data to send
210
+ * @param timeout After this many milliseconds, the promise will resolve to null
211
+ */
212
+ async replyAndWaitForComponent(data, timeout = 300000) {
213
+ const message = await this.reply(data, true);
214
+ const id = `${message.id}-${message.channelId}`;
215
+ return new Promise((resolve) => {
216
+ const timer = setTimeout(() => {
217
+ this.client.componentHandler.oneOffComponents.delete(id);
218
+ resolve({ success: false, message, reason: "timed out" });
219
+ }, timeout);
220
+ this.client.componentHandler.oneOffComponents.set(id, {
221
+ resolve: (data) => {
222
+ clearTimeout(timer);
223
+ this.client.componentHandler.oneOffComponents.delete(id);
224
+ resolve({
225
+ success: true,
226
+ customId: data.custom_id,
227
+ message,
228
+ values: "values" in data ? data.values : undefined
229
+ });
230
+ }
231
+ });
232
+ });
233
+ }
234
+ /**
235
+ * This function will edit to the interaction and wait for a component to be pressed.
236
+ * Any components passed in the message will not have run() functions called and
237
+ * will only trigger the interaction.acknowledge() function.
238
+ * This function will also return a promise that resolves
239
+ * to the custom ID of the component that was pressed.
240
+ *
241
+ * @param data The message data to send
242
+ * @param message The message to edit (defaults to the interaction's original message)
243
+ * @param {number} [timeout=300000] After this many milliseconds, the promise will resolve to null
244
+ *
245
+ * @returns Will return null if the interaction has not yet been replied to or if the message provided no longer exists
246
+ */
247
+ async editAndWaitForComponent(data, message, timeout = 300000) {
248
+ const editedMessage = message
249
+ ? await message.edit(data)
250
+ : await this.message?.edit(data);
251
+ if (!editedMessage)
252
+ return null;
253
+ const id = `${editedMessage.id}-${editedMessage.channelId}`;
254
+ return new Promise((resolve) => {
255
+ const timer = setTimeout(() => {
256
+ this.client.componentHandler.oneOffComponents.delete(id);
257
+ resolve({ success: false, message: editedMessage, reason: "timed out" });
258
+ }, timeout);
259
+ this.client.componentHandler.oneOffComponents.set(id, {
260
+ resolve: (data) => {
261
+ clearTimeout(timer);
262
+ this.client.componentHandler.oneOffComponents.delete(id);
263
+ resolve({
264
+ success: true,
265
+ customId: data.custom_id,
266
+ message: editedMessage,
267
+ values: "values" in data ? data.values : undefined
268
+ });
269
+ }
270
+ });
271
+ });
272
+ }
273
+ }
274
+ //# sourceMappingURL=BaseInteraction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseInteraction.js","sourceRoot":"","sources":["../../../src/abstracts/BaseInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,uBAAuB,EAEvB,YAAY,EAKZ,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,+BAA+B,EAE/B,SAAS,EACT,cAAc,EACd,KAAK,EACL,KAAK,EACL,OAAO,EAEP,GAAG,EACH,OAAO,EACP,IAAI,EACJ,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAM1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAMhC;;GAEG;AACH,MAAM,OAAgB,eAA0C,SAAQ,IAAI;IAC3E;;OAEG;IACH,IAAI,CAAiB;IACrB;;OAEG;IACO,QAAQ,CAAG;IAErB;;OAEG;IACH,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,QAAQ,CAAA;IACrB,CAAC;IACD;;OAEG;IACH,MAAM,CAAoB;IAE1B;;;OAGG;IACH,SAAS,GAAG,KAAK,CAAA;IAET,gBAAgB,GAAG,KAAK,CAAA;IAEhC,YAAY,MAAc,EAAE,IAAO,EAAE,QAA6B;QACjE,KAAK,CAAC,MAAM,CAAC,CAAA;QACb,IAAI,CAAC,QAAQ,GAAG,IAAI,C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ACD,CAAC,CAAA;QACH,CAAC,CAAC,CAAA;IACH,CAAC;CACD"}
@@ -0,0 +1,13 @@
1
+ import type { Client } from "../classes/Client.js";
2
+ import type { ListenerEventAdditionalData, ListenerEventData, ListenerEventRawData, ListenerEventType } from "../types/listeners.js";
3
+ /**
4
+ * Base class for creating event listeners that handle Discord gateway events.
5
+ * This abstract class defines the structure for event listeners and provides type safety for event handling.
6
+ * @abstract
7
+ */
8
+ export declare abstract class BaseListener {
9
+ abstract readonly type: ListenerEventType;
10
+ abstract handle(data: ListenerEventData[this["type"]] & ListenerEventAdditionalData, client: Client): Promise<void>;
11
+ abstract parseRawData(data: ListenerEventRawData[this["type"]] & ListenerEventAdditionalData, client: Client): ListenerEventData[this["type"]];
12
+ }
13
+ //# sourceMappingURL=BaseListener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseListener.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseListener.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EACX,2BAA2B,EAC3B,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,MAAM,uBAAuB,CAAA;AAE9B;;;;GAIG;AACH,8BAAsB,YAAY;IACjC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;IACzC,QAAQ,CAAC,MAAM,CACd,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,2BAA2B,EACnE,MAAM,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC;IAEhB,QAAQ,CAAC,YAAY,CACpB,IAAI,EAAE,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,2BAA2B,EACtE,MAAM,EAAE,MAAM,GACZ,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;CAClC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Base class for creating event listeners that handle Discord gateway events.
3
+ * This abstract class defines the structure for event listeners and provides type safety for event handling.
4
+ * @abstract
5
+ */
6
+ export class BaseListener {
7
+ }
8
+ //# sourceMappingURL=BaseListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseListener.js","sourceRoot":"","sources":["../../../src/abstracts/BaseListener.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,MAAM,OAAgB,YAAY;CAWjC"}
@@ -0,0 +1,41 @@
1
+ import type { APIComponentInMessageActionRow, ComponentType } from "discord-api-types/v10";
2
+ import type { ComponentData, ComponentParserResult, ConditionalComponentOption } from "../types/index.js";
3
+ import { BaseComponent } from "./BaseComponent.js";
4
+ import type { BaseComponentInteraction } from "./BaseComponentInteraction.js";
5
+ export declare abstract class BaseMessageInteractiveComponent extends BaseComponent {
6
+ abstract type: ComponentType.Button | ComponentType.StringSelect | ComponentType.TextInput | ComponentType.UserSelect | ComponentType.RoleSelect | ComponentType.MentionableSelect | ComponentType.ChannelSelect;
7
+ readonly isV2 = false;
8
+ /**
9
+ * Whether the component response should be automatically deferred.
10
+ * Can be a boolean or a function that receives the interaction and returns a boolean.
11
+ */
12
+ defer: boolean | ConditionalComponentOption;
13
+ /**
14
+ * Whether the component response should be ephemeral.
15
+ * Can be a boolean or a function that receives the interaction and returns a boolean.
16
+ */
17
+ ephemeral: boolean | ConditionalComponentOption;
18
+ /**
19
+ * The custom ID of the component.
20
+ * If you want to provide a custom ID with additional data, you should either follow the default parser's format or implement your own custom parser.
21
+ *
22
+ * @see {@link customIdParser}
23
+ */
24
+ abstract customId: string;
25
+ /**
26
+ * This function is called by the handler when a component is received, and is used to parse the custom ID into a key and data object.
27
+ * By default, the ID is parsed in this format: `key:arg1=true;arg2=2;arg3=cheese`, where `arg1`, `arg2`, and `arg3` are the data arguments.
28
+ * It will also automatically parse `true` and `false` as booleans, and will parse numbers as numbers.
29
+ *
30
+ * You can override this to parse the ID in a different format as you see fit, but it must follow these rules:
31
+ * - The ID must have a `key` somewhere in the ID that can be returned by the parser. This key is what Carbon's component handler will use to identify the component and pass an interaction to the correct component.
32
+ * - The data must be able to be arbitrary as far as Carbon's handler is concerned, meaning that any component with the same base key can be treated as the same component with logic within the component's logic methods to handle the data.
33
+ *
34
+ * @param id - The custom ID of the component as received from an interaction event
35
+ * @returns The base key and the data object
36
+ */
37
+ customIdParser: (id: string) => ComponentParserResult;
38
+ abstract serialize: () => APIComponentInMessageActionRow;
39
+ run(interaction: BaseComponentInteraction, data: ComponentData): unknown | Promise<unknown>;
40
+ }
41
+ //# sourceMappingURL=BaseMessageInteractiveComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseMessageInteractiveComponent.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseMessageInteractiveComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,8BAA8B,EAC9B,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EACX,aAAa,EACb,qBAAqB,EACrB,0BAA0B,EAC1B,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAE7E,8BAAsB,+BAAgC,SAAQ,aAAa;IAC1E,QAAQ,CAAC,IAAI,EACV,aAAa,CAAC,MAAM,GACpB,aAAa,CAAC,YAAY,GAC1B,aAAa,CAAC,SAAS,GACvB,aAAa,CAAC,UAAU,GACxB,aAAa,CAAC,UAAU,GACxB,aAAa,CAAC,iBAAiB,GAC/B,aAAa,CAAC,aAAa,CAAA;IAE9B,QAAQ,CAAC,IAAI,SAAQ;IAErB;;;OAGG;IACH,KAAK,EAAE,OAAO,GAAG,0BAA0B,CAAQ;IACnD;;;OAGG;IACH,SAAS,EAAE,OAAO,GAAG,0BAA0B,CAAQ;IAEvD;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IAEzB;;;;;;;;;;;OAWG;IACH,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,qBAAqB,CAAgB;IAErE,QAAQ,CAAC,SAAS,EAAE,MAAM,8BAA8B,CAAA;IAExD,GAAG,CACF,WAAW,EAAE,wBAAwB,EACrC,IAAI,EAAE,aAAa,GACjB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAM7B"}