@buape/carbon 0.2.0 → 0.3.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 (267) hide show
  1. package/dist/package.json +7 -2
  2. package/dist/src/abstracts/BaseComponentInteraction.d.ts +6 -1
  3. package/dist/src/abstracts/BaseComponentInteraction.d.ts.map +1 -1
  4. package/dist/src/abstracts/BaseComponentInteraction.js +12 -0
  5. package/dist/src/abstracts/BaseComponentInteraction.js.map +1 -1
  6. package/dist/src/abstracts/BaseInteraction.d.ts +4 -0
  7. package/dist/src/abstracts/BaseInteraction.d.ts.map +1 -1
  8. package/dist/src/abstracts/BaseInteraction.js +4 -0
  9. package/dist/src/abstracts/BaseInteraction.js.map +1 -1
  10. package/dist/src/classes/Client.d.ts.map +1 -1
  11. package/dist/src/classes/Client.js +21 -11
  12. package/dist/src/classes/Client.js.map +1 -1
  13. package/dist/src/internals/AutocompleteInteraction.d.ts +1 -1
  14. package/dist/src/internals/FieldsHandler.d.ts +27 -0
  15. package/dist/src/internals/FieldsHandler.d.ts.map +1 -0
  16. package/dist/src/internals/FieldsHandler.js +37 -0
  17. package/dist/src/internals/FieldsHandler.js.map +1 -0
  18. package/dist/src/internals/ModalInteraction.d.ts +3 -4
  19. package/dist/src/internals/ModalInteraction.d.ts.map +1 -1
  20. package/dist/src/internals/ModalInteraction.js +3 -10
  21. package/dist/src/internals/ModalInteraction.js.map +1 -1
  22. package/dist/src/internals/OptionsHandler.d.ts +33 -17
  23. package/dist/src/internals/OptionsHandler.d.ts.map +1 -1
  24. package/dist/src/internals/OptionsHandler.js +52 -58
  25. package/dist/src/internals/OptionsHandler.js.map +1 -1
  26. package/dist/src/utils.d.ts +3 -0
  27. package/dist/src/utils.d.ts.map +1 -1
  28. package/dist/src/utils.js +54 -0
  29. package/dist/src/utils.js.map +1 -1
  30. package/dist/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +6 -1
  32. package/.turbo/turbo-build.log +0 -5
  33. package/.turbo/turbo-dev.log +0 -8
  34. package/.turbo/turbo-docs.log +0 -12
  35. package/CHANGELOG.md +0 -44
  36. package/dist/src/abstracts/ButtonInteraction.d.ts +0 -8
  37. package/dist/src/abstracts/ButtonInteraction.d.ts.map +0 -1
  38. package/dist/src/abstracts/ButtonInteraction.js +0 -18
  39. package/dist/src/abstracts/ButtonInteraction.js.map +0 -1
  40. package/dist/src/abstracts/ChannelSelectMenuInteraction.d.ts +0 -7
  41. package/dist/src/abstracts/ChannelSelectMenuInteraction.d.ts.map +0 -1
  42. package/dist/src/abstracts/ChannelSelectMenuInteraction.js +0 -11
  43. package/dist/src/abstracts/ChannelSelectMenuInteraction.js.map +0 -1
  44. package/dist/src/abstracts/CommandHandler.d.ts +0 -6
  45. package/dist/src/abstracts/CommandHandler.d.ts.map +0 -1
  46. package/dist/src/abstracts/CommandHandler.js +0 -65
  47. package/dist/src/abstracts/CommandHandler.js.map +0 -1
  48. package/dist/src/abstracts/CommandInteraction.d.ts +0 -15
  49. package/dist/src/abstracts/CommandInteraction.d.ts.map +0 -1
  50. package/dist/src/abstracts/CommandInteraction.js +0 -60
  51. package/dist/src/abstracts/CommandInteraction.js.map +0 -1
  52. package/dist/src/abstracts/ComponentHandler.d.ts +0 -6
  53. package/dist/src/abstracts/ComponentHandler.d.ts.map +0 -1
  54. package/dist/src/abstracts/ComponentHandler.js +0 -64
  55. package/dist/src/abstracts/ComponentHandler.js.map +0 -1
  56. package/dist/src/abstracts/MentionableSelectMenuInteraction.d.ts +0 -8
  57. package/dist/src/abstracts/MentionableSelectMenuInteraction.d.ts.map +0 -1
  58. package/dist/src/abstracts/MentionableSelectMenuInteraction.js +0 -15
  59. package/dist/src/abstracts/MentionableSelectMenuInteraction.js.map +0 -1
  60. package/dist/src/abstracts/RoleSelectMenuInteraction.d.ts +0 -8
  61. package/dist/src/abstracts/RoleSelectMenuInteraction.d.ts.map +0 -1
  62. package/dist/src/abstracts/RoleSelectMenuInteraction.js +0 -14
  63. package/dist/src/abstracts/RoleSelectMenuInteraction.js.map +0 -1
  64. package/dist/src/abstracts/StringSelectMenuInteraction.d.ts +0 -8
  65. package/dist/src/abstracts/StringSelectMenuInteraction.d.ts.map +0 -1
  66. package/dist/src/abstracts/StringSelectMenuInteraction.js +0 -14
  67. package/dist/src/abstracts/StringSelectMenuInteraction.js.map +0 -1
  68. package/dist/src/abstracts/UserSelectMenuInteraction.d.ts +0 -8
  69. package/dist/src/abstracts/UserSelectMenuInteraction.d.ts.map +0 -1
  70. package/dist/src/abstracts/UserSelectMenuInteraction.js +0 -14
  71. package/dist/src/abstracts/UserSelectMenuInteraction.js.map +0 -1
  72. package/dist/src/classes/Paginator.d.ts +0 -3
  73. package/dist/src/classes/Paginator.d.ts.map +0 -1
  74. package/dist/src/classes/Paginator.js +0 -3
  75. package/dist/src/classes/Paginator.js.map +0 -1
  76. package/dist/src/internals/ComponentHandler copy.d.ts +0 -17
  77. package/dist/src/internals/ComponentHandler copy.d.ts.map +0 -1
  78. package/dist/src/internals/ComponentHandler copy.js +0 -75
  79. package/dist/src/internals/ComponentHandler copy.js.map +0 -1
  80. package/dist/src/structures/AnySelectMenu.d.ts +0 -31
  81. package/dist/src/structures/AnySelectMenu.d.ts.map +0 -1
  82. package/dist/src/structures/AnySelectMenu.js +0 -19
  83. package/dist/src/structures/AnySelectMenu.js.map +0 -1
  84. package/dist/src/structures/AnySelectMenuInteraction.d.ts +0 -12
  85. package/dist/src/structures/AnySelectMenuInteraction.d.ts.map +0 -1
  86. package/dist/src/structures/AnySelectMenuInteraction.js +0 -21
  87. package/dist/src/structures/AnySelectMenuInteraction.js.map +0 -1
  88. package/dist/src/structures/Base.d.ts +0 -10
  89. package/dist/src/structures/Base.d.ts.map +0 -1
  90. package/dist/src/structures/Base.js +0 -11
  91. package/dist/src/structures/Base.js.map +0 -1
  92. package/dist/src/structures/BaseCommand.d.ts +0 -64
  93. package/dist/src/structures/BaseCommand.d.ts.map +0 -1
  94. package/dist/src/structures/BaseCommand.js +0 -58
  95. package/dist/src/structures/BaseCommand.js.map +0 -1
  96. package/dist/src/structures/BaseComponent.d.ts +0 -34
  97. package/dist/src/structures/BaseComponent.d.ts.map +0 -1
  98. package/dist/src/structures/BaseComponent.js +0 -30
  99. package/dist/src/structures/BaseComponent.js.map +0 -1
  100. package/dist/src/structures/BaseComponentInteraction.d.ts +0 -9
  101. package/dist/src/structures/BaseComponentInteraction.d.ts.map +0 -1
  102. package/dist/src/structures/BaseComponentInteraction.js +0 -14
  103. package/dist/src/structures/BaseComponentInteraction.js.map +0 -1
  104. package/dist/src/structures/BaseInteraction.d.ts +0 -81
  105. package/dist/src/structures/BaseInteraction.d.ts.map +0 -1
  106. package/dist/src/structures/BaseInteraction.js +0 -99
  107. package/dist/src/structures/BaseInteraction.js.map +0 -1
  108. package/dist/src/structures/ButtonInteraction.d.ts +0 -8
  109. package/dist/src/structures/ButtonInteraction.d.ts.map +0 -1
  110. package/dist/src/structures/ButtonInteraction.js +0 -18
  111. package/dist/src/structures/ButtonInteraction.js.map +0 -1
  112. package/dist/src/structures/ChannelSelectMenuInteraction.d.ts +0 -7
  113. package/dist/src/structures/ChannelSelectMenuInteraction.d.ts.map +0 -1
  114. package/dist/src/structures/ChannelSelectMenuInteraction.js +0 -11
  115. package/dist/src/structures/ChannelSelectMenuInteraction.js.map +0 -1
  116. package/dist/src/structures/CommandHandler.d.ts +0 -6
  117. package/dist/src/structures/CommandHandler.d.ts.map +0 -1
  118. package/dist/src/structures/CommandHandler.js +0 -70
  119. package/dist/src/structures/CommandHandler.js.map +0 -1
  120. package/dist/src/structures/CommandInteraction.d.ts +0 -15
  121. package/dist/src/structures/CommandInteraction.d.ts.map +0 -1
  122. package/dist/src/structures/CommandInteraction.js +0 -60
  123. package/dist/src/structures/CommandInteraction.js.map +0 -1
  124. package/dist/src/structures/ComponentHandler.d.ts +0 -6
  125. package/dist/src/structures/ComponentHandler.d.ts.map +0 -1
  126. package/dist/src/structures/ComponentHandler.js +0 -64
  127. package/dist/src/structures/ComponentHandler.js.map +0 -1
  128. package/dist/src/structures/MentionableSelectMenuInteraction.d.ts +0 -8
  129. package/dist/src/structures/MentionableSelectMenuInteraction.d.ts.map +0 -1
  130. package/dist/src/structures/MentionableSelectMenuInteraction.js +0 -15
  131. package/dist/src/structures/MentionableSelectMenuInteraction.js.map +0 -1
  132. package/dist/src/structures/RoleSelectMenuInteraction.d.ts +0 -8
  133. package/dist/src/structures/RoleSelectMenuInteraction.d.ts.map +0 -1
  134. package/dist/src/structures/RoleSelectMenuInteraction.js +0 -14
  135. package/dist/src/structures/RoleSelectMenuInteraction.js.map +0 -1
  136. package/dist/src/structures/StringSelectMenuInteraction.d.ts +0 -8
  137. package/dist/src/structures/StringSelectMenuInteraction.d.ts.map +0 -1
  138. package/dist/src/structures/StringSelectMenuInteraction.js +0 -14
  139. package/dist/src/structures/StringSelectMenuInteraction.js.map +0 -1
  140. package/dist/src/structures/UserSelectMenuInteraction.d.ts +0 -8
  141. package/dist/src/structures/UserSelectMenuInteraction.d.ts.map +0 -1
  142. package/dist/src/structures/UserSelectMenuInteraction.js +0 -14
  143. package/dist/src/structures/UserSelectMenuInteraction.js.map +0 -1
  144. package/dist/src/types.d.ts +0 -31
  145. package/dist/src/types.d.ts.map +0 -1
  146. package/dist/src/types.js +0 -33
  147. package/dist/src/types.js.map +0 -1
  148. package/docs/classes/AnySelectMenu.mdx +0 -114
  149. package/docs/classes/AnySelectMenuInteraction.mdx +0 -175
  150. package/docs/classes/AutocompleteInteraction.mdx +0 -166
  151. package/docs/classes/AutocompleteOptionsHandler.mdx +0 -243
  152. package/docs/classes/BaseChannel.mdx +0 -97
  153. package/docs/classes/BaseCommand.mdx +0 -61
  154. package/docs/classes/BaseComponent.mdx +0 -55
  155. package/docs/classes/BaseComponentInteraction.mdx +0 -160
  156. package/docs/classes/BaseGuildChannel.mdx +0 -262
  157. package/docs/classes/BaseGuildTextChannel.mdx +0 -360
  158. package/docs/classes/BaseInteraction.mdx +0 -137
  159. package/docs/classes/Button.mdx +0 -99
  160. package/docs/classes/ButtonInteraction.mdx +0 -155
  161. package/docs/classes/ChannelSelectMenu.mdx +0 -122
  162. package/docs/classes/ChannelSelectMenuInteraction.mdx +0 -171
  163. package/docs/classes/Client.mdx +0 -48
  164. package/docs/classes/Command.mdx +0 -111
  165. package/docs/classes/CommandHandler.mdx +0 -65
  166. package/docs/classes/CommandInteraction.mdx +0 -155
  167. package/docs/classes/CommandWithSubcommandGroups.mdx +0 -73
  168. package/docs/classes/CommandWithSubcommands.mdx +0 -76
  169. package/docs/classes/ComponentHandler.mdx +0 -49
  170. package/docs/classes/DmChannel.mdx +0 -118
  171. package/docs/classes/GroupDmChannel.mdx +0 -197
  172. package/docs/classes/Guild.mdx +0 -157
  173. package/docs/classes/GuildAnnouncementChannel.mdx +0 -377
  174. package/docs/classes/GuildCategoryChannel.mdx +0 -272
  175. package/docs/classes/GuildForumChannel.mdx +0 -333
  176. package/docs/classes/GuildMediaChannel.mdx +0 -327
  177. package/docs/classes/GuildStageChannel.mdx +0 -276
  178. package/docs/classes/GuildStageOrVoiceChannel.mdx +0 -292
  179. package/docs/classes/GuildTextChannel.mdx +0 -367
  180. package/docs/classes/GuildThreadChannel.mdx +0 -425
  181. package/docs/classes/GuildThreadOnlyChannel.mdx +0 -333
  182. package/docs/classes/GuildVoiceChannel.mdx +0 -276
  183. package/docs/classes/LinkButton.mdx +0 -84
  184. package/docs/classes/MentionableSelectMenu.mdx +0 -120
  185. package/docs/classes/MentionableSelectMenuInteraction.mdx +0 -171
  186. package/docs/classes/Message.mdx +0 -126
  187. package/docs/classes/OptionsHandler.mdx +0 -203
  188. package/docs/classes/PremiumButton.mdx +0 -84
  189. package/docs/classes/Role.mdx +0 -228
  190. package/docs/classes/RoleSelectMenu.mdx +0 -120
  191. package/docs/classes/RoleSelectMenuInteraction.mdx +0 -171
  192. package/docs/classes/Row.mdx +0 -88
  193. package/docs/classes/StringSelectMenu.mdx +0 -120
  194. package/docs/classes/StringSelectMenuInteraction.mdx +0 -171
  195. package/docs/classes/User.mdx +0 -119
  196. package/docs/classes/UserSelectMenu.mdx +0 -120
  197. package/docs/classes/UserSelectMenuInteraction.mdx +0 -171
  198. package/docs/enumerations/ClientMode.mdx +0 -16
  199. package/docs/functions/channelFactory.mdx +0 -16
  200. package/docs/index.mdx +0 -83
  201. package/docs/type-aliases/AnySelectMenuComponentType.mdx +0 -5
  202. package/docs/type-aliases/ClientOptions.mdx +0 -20
  203. package/docs/type-aliases/CommandOptions.mdx +0 -5
  204. package/docs/type-aliases/ComponentAdditionalData.mdx +0 -9
  205. package/docs/type-aliases/InteractionFileData.mdx +0 -15
  206. package/docs/type-aliases/InteractionReplyData.mdx +0 -14
  207. package/docs/type-aliases/InteractionReplyOptions.mdx +0 -13
  208. package/docs/type-aliases/RawOptions.mdx +0 -9
  209. package/docs/type-aliases/meta.json +0 -3
  210. package/src/README.md +0 -7
  211. package/src/abstracts/AnySelectMenu.ts +0 -63
  212. package/src/abstracts/AnySelectMenuInteraction.ts +0 -29
  213. package/src/abstracts/Base.ts +0 -12
  214. package/src/abstracts/BaseChannel.ts +0 -73
  215. package/src/abstracts/BaseCommand.ts +0 -89
  216. package/src/abstracts/BaseComponent.ts +0 -49
  217. package/src/abstracts/BaseComponentInteraction.ts +0 -19
  218. package/src/abstracts/BaseGuildChannel.ts +0 -152
  219. package/src/abstracts/BaseGuildTextChannel.ts +0 -77
  220. package/src/abstracts/BaseInteraction.ts +0 -209
  221. package/src/abstracts/GuildThreadOnlyChannel.ts +0 -71
  222. package/src/classes/Button.ts +0 -95
  223. package/src/classes/ChannelSelectMenu.ts +0 -21
  224. package/src/classes/Client.ts +0 -277
  225. package/src/classes/Command.ts +0 -53
  226. package/src/classes/CommandWithSubcommandGroups.ts +0 -47
  227. package/src/classes/CommandWithSubcommands.ts +0 -35
  228. package/src/classes/MentionableSelectMenu.ts +0 -19
  229. package/src/classes/Modal.ts +0 -38
  230. package/src/classes/RoleSelectMenu.ts +0 -19
  231. package/src/classes/Row.ts +0 -50
  232. package/src/classes/StringSelectMenu.ts +0 -19
  233. package/src/classes/TextInput.ts +0 -65
  234. package/src/classes/UserSelectMenu.ts +0 -19
  235. package/src/factories/channelFactory.ts +0 -43
  236. package/src/index.ts +0 -62
  237. package/src/internals/AutocompleteInteraction.ts +0 -107
  238. package/src/internals/ButtonInteraction.ts +0 -26
  239. package/src/internals/ChannelSelectMenuInteraction.ts +0 -15
  240. package/src/internals/CommandHandler.ts +0 -127
  241. package/src/internals/CommandInteraction.ts +0 -49
  242. package/src/internals/ComponentHandler.ts +0 -92
  243. package/src/internals/MentionableSelectMenuInteraction.ts +0 -21
  244. package/src/internals/ModalHandler.ts +0 -27
  245. package/src/internals/ModalInteraction.ts +0 -25
  246. package/src/internals/OptionsHandler.ts +0 -148
  247. package/src/internals/RoleSelectMenuInteraction.ts +0 -20
  248. package/src/internals/StringSelectMenuInteraction.ts +0 -20
  249. package/src/internals/UserSelectMenuInteraction.ts +0 -20
  250. package/src/structures/DmChannel.ts +0 -31
  251. package/src/structures/GroupDmChannel.ts +0 -132
  252. package/src/structures/Guild.ts +0 -154
  253. package/src/structures/GuildAnnouncementChannel.ts +0 -20
  254. package/src/structures/GuildCategoryChannel.ts +0 -16
  255. package/src/structures/GuildForumChannel.ts +0 -20
  256. package/src/structures/GuildMediaChannel.ts +0 -13
  257. package/src/structures/GuildMember.ts +0 -231
  258. package/src/structures/GuildStageOrVoiceChannel.ts +0 -46
  259. package/src/structures/GuildTextChannel.ts +0 -21
  260. package/src/structures/GuildThreadChannel.ts +0 -150
  261. package/src/structures/Message.ts +0 -124
  262. package/src/structures/Role.ts +0 -201
  263. package/src/structures/User.ts +0 -153
  264. package/src/utils.ts +0 -13
  265. package/tests/index.test.ts +0 -4
  266. package/tsconfig.json +0 -12
  267. package/typedoc.json +0 -9
@@ -1,8 +0,0 @@
1
- import { type APIMessageComponentButtonInteraction } from "discord-api-types/v10";
2
- import type { Client } from "../classes/Client.js";
3
- import { BaseComponentInteraction } from "./BaseComponentInteraction.js";
4
- export declare class ButtonInteraction extends BaseComponentInteraction {
5
- customId: string;
6
- constructor(client: Client, data: APIMessageComponentButtonInteraction);
7
- }
8
- //# sourceMappingURL=ButtonInteraction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ButtonInteraction.d.ts","sourceRoot":"","sources":["../../../src/abstracts/ButtonInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,oCAAoC,EAGzC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAExE,qBAAa,iBAAkB,SAAQ,wBAAwB;IAC9D,QAAQ,EAAE,MAAM,CAEZ;gBACQ,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,oCAAoC;CAWtE"}
@@ -1,18 +0,0 @@
1
- import { ComponentType, InteractionType } from "discord-api-types/v10";
2
- import { splitCustomId } from "../utils.js";
3
- import { BaseComponentInteraction } from "./BaseComponentInteraction.js";
4
- export class ButtonInteraction extends BaseComponentInteraction {
5
- customId = splitCustomId(this.rawData.data.custom_id)[0];
6
- constructor(client, data) {
7
- super(client, data);
8
- if (!data.data)
9
- throw new Error("Invalid interaction data was used to create this class");
10
- if (data.type !== InteractionType.MessageComponent) {
11
- throw new Error("Invalid interaction type was used to create this class");
12
- }
13
- if (data.data.component_type !== ComponentType.Button) {
14
- throw new Error("Invalid component type was used to create this class");
15
- }
16
- }
17
- }
18
- //# sourceMappingURL=ButtonInteraction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ButtonInteraction.js","sourceRoot":"","sources":["../../../src/abstracts/ButtonInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,aAAa,EACb,eAAe,EACf,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAExE,MAAM,OAAO,iBAAkB,SAAQ,wBAAwB;IAC9D,QAAQ,GAAW,aAAa,CAC9B,IAAI,CAAC,OAAO,CAAC,IAAwC,CAAC,SAAS,CAChE,CAAC,CAAC,CAAC,CAAA;IACJ,YAAY,MAAc,EAAE,IAA0C;QACrE,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QACnB,IAAI,CAAC,IAAI,CAAC,IAAI;YACb,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;QAC1E,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe,CAAC,gBAAgB,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;QAC1E,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,KAAK,aAAa,CAAC,MAAM,EAAE,CAAC;YACvD,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;QACxE,CAAC;IACF,CAAC;CACD"}
@@ -1,7 +0,0 @@
1
- import { type APIMessageComponentSelectMenuInteraction } from "discord-api-types/v10";
2
- import type { Client } from "../classes/Client.js";
3
- import { AnySelectMenuInteraction } from "./AnySelectMenuInteraction.js";
4
- export declare class ChannelSelectMenuInteraction extends AnySelectMenuInteraction {
5
- constructor(client: Client, data: APIMessageComponentSelectMenuInteraction);
6
- }
7
- //# sourceMappingURL=ChannelSelectMenuInteraction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChannelSelectMenuInteraction.d.ts","sourceRoot":"","sources":["../../../src/abstracts/ChannelSelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,wCAAwC,EAE7C,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAExE,qBAAa,4BAA6B,SAAQ,wBAAwB;gBAC7D,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,wCAAwC;CAM1E"}
@@ -1,11 +0,0 @@
1
- import { ComponentType } from "discord-api-types/v10";
2
- import { AnySelectMenuInteraction } from "./AnySelectMenuInteraction.js";
3
- export class ChannelSelectMenuInteraction extends AnySelectMenuInteraction {
4
- constructor(client, data) {
5
- super(client, data);
6
- if (data.data.component_type !== ComponentType.ChannelSelect) {
7
- throw new Error("Invalid component type was used to create this class");
8
- }
9
- }
10
- }
11
- //# sourceMappingURL=ChannelSelectMenuInteraction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChannelSelectMenuInteraction.js","sourceRoot":"","sources":["../../../src/abstracts/ChannelSelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,aAAa,EACb,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAExE,MAAM,OAAO,4BAA6B,SAAQ,wBAAwB;IACzE,YAAY,MAAc,EAAE,IAA8C;QACzE,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QACnB,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,KAAK,aAAa,CAAC,aAAa,EAAE,CAAC;YAC9D,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;QACxE,CAAC;IACF,CAAC;CACD"}
@@ -1,6 +0,0 @@
1
- import { type APIApplicationCommandInteraction } from "discord-api-types/v10";
2
- import { Base } from "./Base.js";
3
- export declare class CommandHandler extends Base {
4
- handleInteraction(rawInteraction: APIApplicationCommandInteraction): Promise<false | void>;
5
- }
6
- //# sourceMappingURL=CommandHandler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommandHandler.d.ts","sourceRoot":"","sources":["../../../src/abstracts/CommandHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,gCAAgC,EAKrC,MAAM,uBAAuB,CAAA;AAI9B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,qBAAa,cAAe,SAAQ,IAAI;IACjC,iBAAiB,CAAC,cAAc,EAAE,gCAAgC;CAoFxE"}
@@ -1,65 +0,0 @@
1
- import { ApplicationCommandOptionType, ApplicationCommandType } from "discord-api-types/v10";
2
- import { Command } from "../classes/Command.js";
3
- import { CommandWithSubcommandGroups } from "../classes/CommandWithSubcommandGroups.js";
4
- import { CommandWithSubcommands } from "../classes/CommandWithSubcommands.js";
5
- import { Base } from "./Base.js";
6
- import { CommandInteraction } from "./CommandInteraction.js";
7
- export class CommandHandler extends Base {
8
- async handleInteraction(rawInteraction) {
9
- const command = this.client.commands.find((x) => x.name === rawInteraction.data.name);
10
- if (!command)
11
- return false;
12
- const interaction = new CommandInteraction(this.client, rawInteraction, command);
13
- if (command instanceof Command) {
14
- if (command.defer) {
15
- await interaction.defer();
16
- }
17
- await command.run(interaction);
18
- return;
19
- }
20
- if (command instanceof CommandWithSubcommandGroups) {
21
- if (rawInteraction.data.type !== ApplicationCommandType.ChatInput) {
22
- return await interaction.reply({
23
- content: "Subcommand groups must be used with ChatInput"
24
- });
25
- }
26
- const data = rawInteraction.data;
27
- const subcommandGroupName = data.options?.find((x) => x.type === ApplicationCommandOptionType.SubcommandGroup)?.name;
28
- if (!subcommandGroupName)
29
- return false;
30
- const subcommandGroup = command.subcommandGroups.find((x) => x.name === subcommandGroupName);
31
- if (!subcommandGroup)
32
- return false;
33
- const subcommandName = (data.options?.find((x) => x.type === ApplicationCommandOptionType.SubcommandGroup)).options?.find((x) => x.type === ApplicationCommandOptionType.Subcommand)?.name;
34
- if (!subcommandName)
35
- return false;
36
- const subcommand = subcommandGroup.subcommands.find((x) => x.name === subcommandName);
37
- if (!subcommand)
38
- return false;
39
- if (subcommand.defer) {
40
- await interaction.defer();
41
- }
42
- return await subcommand.run(interaction);
43
- }
44
- if (command instanceof CommandWithSubcommands) {
45
- if (rawInteraction.data.type !== ApplicationCommandType.ChatInput) {
46
- return interaction.reply({
47
- content: "Subcommands must be used with ChatInput"
48
- });
49
- }
50
- const data = rawInteraction.data;
51
- const subcommand = command.subcommands.find((x) => x.name === data.options?.[0]?.name);
52
- if (!subcommand)
53
- return false;
54
- if (subcommand.defer) {
55
- await interaction.defer();
56
- }
57
- return await subcommand.run(interaction);
58
- }
59
- console.error(`Command ${command.name} is not a valid command type`);
60
- console.debug(rawInteraction.data
61
- .options);
62
- return false;
63
- }
64
- }
65
- //# sourceMappingURL=CommandHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommandHandler.js","sourceRoot":"","sources":["../../../src/abstracts/CommandHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,4BAA4B,EAC5B,sBAAsB,EACtB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAA;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D,MAAM,OAAO,cAAe,SAAQ,IAAI;IACvC,KAAK,CAAC,iBAAiB,CAAC,cAAgD;QACvE,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CACxC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,cAAc,CAAC,IAAI,CAAC,IAAI,CAC1C,CAAA;QACD,IAAI,CAAC,OAAO;YAAE,OAAO,KAAK,CAAA;QAE1B,MAAM,WAAW,GAAG,IAAI,kBAAkB,CACzC,IAAI,CAAC,MAAM,EACX,cAAc,EACd,OAAO,CACP,CAAA;QAED,IAAI,OAAO,YAAY,OAAO,EAAE,CAAC;YAChC,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;gBACnB,MAAM,WAAW,CAAC,KAAK,EAA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AA;YAED,IAAI,CAAC,UAAU;gBAAE,OAAO,KAAK,CAAA;YAE7B,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;gBACtB,MAAM,WAAW,CAAC,KAAK,EAAE,CAAA;YAC1B,CAAC;YACD,OAAO,MAAM,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QACzC,CAAC;QAED,IAAI,OAAO,YAAY,sBAAsB,EAAE,CAAC;YAC/C,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,KAAK,sBAAsB,CAAC,SAAS,EAAE,CAAC;gBACnE,OAAO,WAAW,CAAC,KAAK,CAAC;oBACxB,OAAO,EAAE,yCAAyC;iBAClD,CAAC,CAAA;YACH,CAAC;YACD,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAA;YAChC,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAC1C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CACzC,CAAA;YACD,IAAI,CAAC,UAAU;gBAAE,OAAO,KAAK,CAAA;YAE7B,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;gBACtB,MAAM,WAAW,CAAC,KAAK,EAAE,CAAA;YAC1B,CAAC;YACD,OAAO,MAAM,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QACzC,CAAC;QAED,OAAO,CAAC,KAAK,CAAC,WAAW,OAAO,CAAC,IAAI,8BAA8B,CAAC,CAAA;QACpE,OAAO,CAAC,KAAK,CACX,cAAc,CAAC,IAAsD;aACpE,OAAO,CACT,CAAA;QACD,OAAO,KAAK,CAAA;IACb,CAAC;CACD"}
@@ -1,15 +0,0 @@
1
- import { type APIApplicationCommandInteraction, type APIApplicationCommandInteractionDataBasicOption } from "discord-api-types/v10";
2
- import type { Client } from "../classes/Client.js";
3
- import type { BaseCommand } from "./BaseCommand.js";
4
- import { BaseInteraction } from "./BaseInteraction.js";
5
- /**
6
- * Represents a command interaction
7
- */
8
- export declare class CommandInteraction extends BaseInteraction<APIApplicationCommandInteraction> {
9
- options: {
10
- [key: string]: APIApplicationCommandInteractionDataBasicOption["value"] | undefined;
11
- };
12
- constructor(client: Client, data: APIApplicationCommandInteraction, command?: BaseCommand);
13
- private parseOptions;
14
- }
15
- //# sourceMappingURL=CommandInteraction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommandInteraction.d.ts","sourceRoot":"","sources":["../../../src/abstracts/CommandInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,gCAAgC,EACrC,KAAK,+CAA+C,EAIpD,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe,CAAC,gCAAgC,CAAC;IACxF,OAAO,EAAE;QACR,CAAC,GAAG,EAAE,MAAM,GACT,+CAA+C,CAAC,OAAO,CAAC,GACxD,SAAS,CAAA;KACZ,CAAK;gBAEL,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,gCAAgC,EACtC,OAAO,CAAC,EAAE,WAAW;IAsBtB,OAAO,CAAC,YAAY,CAsCnB;CACD"}
@@ -1,60 +0,0 @@
1
- import { ApplicationCommandOptionType, ApplicationCommandType, InteractionType } from "discord-api-types/v10";
2
- import { Command } from "../classes/Command.js";
3
- import { BaseInteraction } from "./BaseInteraction.js";
4
- /**
5
- * Represents a command interaction
6
- */
7
- export class CommandInteraction extends BaseInteraction {
8
- options = {};
9
- constructor(client, data, command) {
10
- super(client, data);
11
- if (data.type !== InteractionType.ApplicationCommand) {
12
- throw new Error("Invalid interaction type was used to create this class");
13
- }
14
- if (data.data.type !== ApplicationCommandType.ChatInput) {
15
- throw new Error("Invalid command type was used to create this class");
16
- }
17
- if (command &&
18
- command instanceof Command &&
19
- data.data.type === ApplicationCommandType.ChatInput) {
20
- this.options = this.parseOptions(command, (data.data.options ??
21
- []));
22
- }
23
- }
24
- parseOptions = (command, options) => {
25
- const result = {};
26
- for (const option of options) {
27
- const optionData = command.options?.find((x) => x.name === option.name);
28
- if (!optionData) {
29
- result[option.name] = undefined;
30
- }
31
- else {
32
- switch (optionData.type) {
33
- case ApplicationCommandOptionType.String:
34
- result[option.name] = option.value;
35
- break;
36
- case ApplicationCommandOptionType.Integer:
37
- result[option.name] = option.value;
38
- break;
39
- case ApplicationCommandOptionType.Boolean:
40
- result[option.name] = option.value;
41
- break;
42
- case ApplicationCommandOptionType.User:
43
- result[option.name] = option.value;
44
- break;
45
- case ApplicationCommandOptionType.Channel:
46
- result[option.name] = option.value;
47
- break;
48
- case ApplicationCommandOptionType.Role:
49
- result[option.name] = option.value;
50
- break;
51
- case ApplicationCommandOptionType.Mentionable:
52
- result[option.name] = option.value;
53
- break;
54
- }
55
- }
56
- }
57
- return result;
58
- };
59
- }
60
- //# sourceMappingURL=CommandInteraction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommandInteraction.js","sourceRoot":"","sources":["../../../src/abstracts/CommandInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,4BAA4B,EAC5B,sBAAsB,EACtB,eAAe,EACf,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,eAAiD;IACxF,OAAO,GAIH,EAAE,CAAA;IACN,YACC,MAAc,EACd,IAAsC,EACtC,OAAqB;QAErB,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QACnB,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe,CAAC,kBAAkB,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AM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAgB,CAAA;wBAC7C,MAAK;oBACN,KAAK,4BAA4B,CAAC,IAAI;wBACrC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAe,CAAA;wBAC5C,MAAK;oBACN,KAAK,4BAA4B,CAAC,OAAO;wBACxC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAe,CAAA;wBAC5C,MAAK;oBACN,KAAK,4BAA4B,CAAC,IAAI;wBACrC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAe,CAAA;wBAC5C,MAAK;oBACN,KAAK,4BAA4B,CAAC,WAAW;wBAC5C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAe,CAAA;wBAC5C,MAAK;gBACP,CAAC;YACF,CAAC;QACF,CAAC;QACD,OAAO,MAAM,CAAA;IACd,CAAC,CAAA;CACD"}
@@ -1,6 +0,0 @@
1
- import type { APIMessageComponentInteraction } from "discord-api-types/v10";
2
- import { Base } from "./Base.js";
3
- export declare class ComponentHandler extends Base {
4
- handleInteraction(data: APIMessageComponentInteraction): Promise<false | undefined>;
5
- }
6
- //# sourceMappingURL=ComponentHandler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ComponentHandler.d.ts","sourceRoot":"","sources":["../../../src/abstracts/ComponentHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,8BAA8B,EAE9B,MAAM,uBAAuB,CAAA;AAO9B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAShC,qBAAa,gBAAiB,SAAQ,IAAI;IACnC,iBAAiB,CAAC,IAAI,EAAE,8BAA8B;CA2D5D"}
@@ -1,64 +0,0 @@
1
- import { Button } from "../classes/Button.js";
2
- import { ChannelSelectMenu } from "../classes/ChannelSelectMenu.js";
3
- import { MentionableSelectMenu } from "../classes/MentionableSelectMenu.js";
4
- import { RoleSelectMenu } from "../classes/RoleSelectMenu.js";
5
- import { StringSelectMenu } from "../classes/StringSelectMenu.js";
6
- import { UserSelectMenu } from "../classes/UserSelectMenu.js";
7
- import { Base } from "./Base.js";
8
- import { ButtonInteraction } from "./ButtonInteraction.js";
9
- import { ChannelSelectMenuInteraction } from "./ChannelSelectMenuInteraction.js";
10
- import { MentionableSelectMenuInteraction } from "./MentionableSelectMenuInteraction.js";
11
- import { RoleSelectMenuInteraction } from "./RoleSelectMenuInteraction.js";
12
- import { StringSelectMenuInteraction } from "./StringSelectMenuInteraction.js";
13
- import { UserSelectMenuInteraction } from "./UserSelectMenuInteraction.js";
14
- export class ComponentHandler extends Base {
15
- async handleInteraction(data) {
16
- const allComponents = this.client.commands
17
- .filter((x) => x.components && x.components.length > 0)
18
- .flatMap((x) => x.components);
19
- const component = allComponents.find((x) => x.customId === data.data.custom_id &&
20
- x.type === data.data.component_type);
21
- if (!component)
22
- return false;
23
- if (component instanceof Button) {
24
- const interaction = new ButtonInteraction(this.client, data);
25
- if (component.defer)
26
- await interaction.defer();
27
- await component.run(interaction);
28
- }
29
- else if (component instanceof RoleSelectMenu) {
30
- const interaction = new RoleSelectMenuInteraction(this.client, data);
31
- if (component.defer)
32
- await interaction.defer();
33
- await component.run(interaction);
34
- }
35
- else if (component instanceof ChannelSelectMenu) {
36
- const interaction = new ChannelSelectMenuInteraction(this.client, data);
37
- if (component.defer)
38
- await interaction.defer();
39
- await component.run(interaction);
40
- }
41
- else if (component instanceof MentionableSelectMenu) {
42
- const interaction = new MentionableSelectMenuInteraction(this.client, data);
43
- if (component.defer)
44
- await interaction.defer();
45
- await component.run(interaction);
46
- }
47
- else if (component instanceof StringSelectMenu) {
48
- const interaction = new StringSelectMenuInteraction(this.client, data);
49
- if (component.defer)
50
- await interaction.defer();
51
- await component.run(interaction);
52
- }
53
- else if (component instanceof UserSelectMenu) {
54
- const interaction = new UserSelectMenuInteraction(this.client, data);
55
- if (component.defer)
56
- await interaction.defer();
57
- await component.run(interaction);
58
- }
59
- else {
60
- throw new Error(`Unknown component with type ${data.data.component_type} and custom ID ${data.data.custom_id}`);
61
- }
62
- }
63
- }
64
- //# sourceMappingURL=ComponentHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ComponentHandler.js","sourceRoot":"","sources":["../../../src/abstracts/ComponentHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AAChF,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAA;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAE1E,MAAM,OAAO,gBAAiB,SAAQ,IAAI;IACzC,KAAK,CAAC,iBAAiB,CAAC,IAAoC;QAC3D,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ;aACxC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;aACtD,OAAO,CAAC,CAAC,CAAC,EAAE,E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A;YACD,IAAI,SAAS,CAAC,KAAK;gBAAE,MAAM,WAAW,CAAC,KAAK,EAAE,CAAA;YAC9C,MAAM,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QACjC,CAAC;aAAM,IAAI,SAAS,YAAY,gBAAgB,EAAE,CAAC;YAClD,MAAM,WAAW,GAAG,IAAI,2BAA2B,CAClD,IAAI,CAAC,MAAM,EACX,IAAgD,CAChD,CAAA;YACD,IAAI,SAAS,CAAC,KAAK;gBAAE,MAAM,WAAW,CAAC,KAAK,EAAE,CAAA;YAC9C,MAAM,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QACjC,CAAC;aAAM,IAAI,SAAS,YAAY,cAAc,EAAE,CAAC;YAChD,MAAM,WAAW,GAAG,IAAI,yBAAyB,CAChD,IAAI,CAAC,MAAM,EACX,IAAgD,CAChD,CAAA;YACD,IAAI,SAAS,CAAC,KAAK;gBAAE,MAAM,WAAW,CAAC,KAAK,EAAE,CAAA;YAC9C,MAAM,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QACjC,CAAC;aAAM,CAAC;YACP,MAAM,IAAI,KAAK,CACd,+BAA+B,IAAI,CAAC,IAAI,CAAC,cAAc,kBAAkB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAC9F,CAAA;QACF,CAAC;IACF,CAAC;CACD"}
@@ -1,8 +0,0 @@
1
- import { type APIMessageComponentSelectMenuInteraction } from "discord-api-types/v10";
2
- import type { Client } from "../classes/Client.js";
3
- import { AnySelectMenuInteraction } from "./AnySelectMenuInteraction.js";
4
- export declare class MentionableSelectMenuInteraction extends AnySelectMenuInteraction {
5
- constructor(client: Client, data: APIMessageComponentSelectMenuInteraction);
6
- get values(): string[];
7
- }
8
- //# sourceMappingURL=MentionableSelectMenuInteraction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MentionableSelectMenuInteraction.d.ts","sourceRoot":"","sources":["../../../src/abstracts/MentionableSelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,wCAAwC,EAG7C,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAExE,qBAAa,gCAAiC,SAAQ,wBAAwB;gBACjE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,wCAAwC;IAO1E,IAAI,MAAM,IAAI,MAAM,EAAE,CAGrB;CACD"}
@@ -1,15 +0,0 @@
1
- import { ComponentType } from "discord-api-types/v10";
2
- import { AnySelectMenuInteraction } from "./AnySelectMenuInteraction.js";
3
- export class MentionableSelectMenuInteraction extends AnySelectMenuInteraction {
4
- constructor(client, data) {
5
- super(client, data);
6
- if (data.data.component_type !== ComponentType.MentionableSelect) {
7
- throw new Error("Invalid component type was used to create this class");
8
- }
9
- }
10
- get values() {
11
- return this.rawData.data
12
- .values;
13
- }
14
- }
15
- //# sourceMappingURL=MentionableSelectMenuInteraction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MentionableSelectMenuInteraction.js","sourceRoot":"","sources":["../../../src/abstracts/MentionableSelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,aAAa,EACb,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAExE,MAAM,OAAO,gCAAiC,SAAQ,wBAAwB;IAC7E,YAAY,MAAc,EAAE,IAA8C;QACzE,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QACnB,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,KAAK,aAAa,CAAC,iBAAiB,EAAE,CAAC;YAClE,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;QACxE,CAAC;IACF,CAAC;IAED,IAAI,MAAM;QACT,OAAQ,IAAI,CAAC,OAAO,CAAC,IAAmD;aACtE,MAAM,CAAA;IACT,CAAC;CACD"}
@@ -1,8 +0,0 @@
1
- import { type APIMessageComponentSelectMenuInteraction } from "discord-api-types/v10";
2
- import type { Client } from "../classes/Client.js";
3
- import { AnySelectMenuInteraction } from "./AnySelectMenuInteraction.js";
4
- export declare class RoleSelectMenuInteraction extends AnySelectMenuInteraction {
5
- constructor(client: Client, data: APIMessageComponentSelectMenuInteraction);
6
- get values(): string[];
7
- }
8
- //# sourceMappingURL=RoleSelectMenuInteraction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RoleSelectMenuInteraction.d.ts","sourceRoot":"","sources":["../../../src/abstracts/RoleSelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,wCAAwC,EAG7C,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAExE,qBAAa,yBAA0B,SAAQ,wBAAwB;gBAC1D,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,wCAAwC;IAO1E,IAAI,MAAM,IAAI,MAAM,EAAE,CAErB;CACD"}
@@ -1,14 +0,0 @@
1
- import { ComponentType } from "discord-api-types/v10";
2
- import { AnySelectMenuInteraction } from "./AnySelectMenuInteraction.js";
3
- export class RoleSelectMenuInteraction extends AnySelectMenuInteraction {
4
- constructor(client, data) {
5
- super(client, data);
6
- if (data.data.component_type !== ComponentType.RoleSelect) {
7
- throw new Error("Invalid component type was used to create this class");
8
- }
9
- }
10
- get values() {
11
- return this.rawData.data.values;
12
- }
13
- }
14
- //# sourceMappingURL=RoleSelectMenuInteraction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RoleSelectMenuInteraction.js","sourceRoot":"","sources":["../../../src/abstracts/RoleSelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,aAAa,EACb,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAExE,MAAM,OAAO,yBAA0B,SAAQ,wBAAwB;IACtE,YAAY,MAAc,EAAE,IAA8C;QACzE,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QACnB,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,KAAK,aAAa,CAAC,UAAU,EAAE,CAAC;YAC3D,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;QACxE,CAAC;IACF,CAAC;IAED,IAAI,MAAM;QACT,OAAQ,IAAI,CAAC,OAAO,CAAC,IAA4C,CAAC,MAAM,CAAA;IACzE,CAAC;CACD"}
@@ -1,8 +0,0 @@
1
- import { type APIMessageComponentSelectMenuInteraction } from "discord-api-types/v10";
2
- import type { Client } from "../classes/Client.js";
3
- import { AnySelectMenuInteraction } from "./AnySelectMenuInteraction.js";
4
- export declare class StringSelectMenuInteraction extends AnySelectMenuInteraction {
5
- constructor(client: Client, data: APIMessageComponentSelectMenuInteraction);
6
- get values(): string[];
7
- }
8
- //# sourceMappingURL=StringSelectMenuInteraction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StringSelectMenuInteraction.d.ts","sourceRoot":"","sources":["../../../src/abstracts/StringSelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,wCAAwC,EAG7C,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAExE,qBAAa,2BAA4B,SAAQ,wBAAwB;gBAC5D,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,wCAAwC;IAO1E,IAAI,MAAM,IAAI,MAAM,EAAE,CAErB;CACD"}
@@ -1,14 +0,0 @@
1
- import { ComponentType } from "discord-api-types/v10";
2
- import { AnySelectMenuInteraction } from "./AnySelectMenuInteraction.js";
3
- export class StringSelectMenuInteraction extends AnySelectMenuInteraction {
4
- constructor(client, data) {
5
- super(client, data);
6
- if (data.data.component_type !== ComponentType.StringSelect) {
7
- throw new Error("Invalid component type was used to create this class");
8
- }
9
- }
10
- get values() {
11
- return this.rawData.data.values;
12
- }
13
- }
14
- //# sourceMappingURL=StringSelectMenuInteraction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StringSelectMenuInteraction.js","sourceRoot":"","sources":["../../../src/abstracts/StringSelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,aAAa,EACb,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAExE,MAAM,OAAO,2BAA4B,SAAQ,wBAAwB;IACxE,YAAY,MAAc,EAAE,IAA8C;QACzE,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QACnB,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,KAAK,aAAa,CAAC,YAAY,EAAE,CAAC;YAC7D,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;QACxE,CAAC;IACF,CAAC;IAED,IAAI,MAAM;QACT,OAAQ,IAAI,CAAC,OAAO,CAAC,IAA8C,CAAC,MAAM,CAAA;IAC3E,CAAC;CACD"}
@@ -1,8 +0,0 @@
1
- import { type APIMessageComponentSelectMenuInteraction } from "discord-api-types/v10";
2
- import type { Client } from "../classes/Client.js";
3
- import { AnySelectMenuInteraction } from "./AnySelectMenuInteraction.js";
4
- export declare class UserSelectMenuInteraction extends AnySelectMenuInteraction {
5
- constructor(client: Client, data: APIMessageComponentSelectMenuInteraction);
6
- get values(): string[];
7
- }
8
- //# sourceMappingURL=UserSelectMenuInteraction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UserSelectMenuInteraction.d.ts","sourceRoot":"","sources":["../../../src/abstracts/UserSelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,wCAAwC,EAG7C,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAExE,qBAAa,yBAA0B,SAAQ,wBAAwB;gBAC1D,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,wCAAwC;IAO1E,IAAI,MAAM,IAAI,MAAM,EAAE,CAErB;CACD"}
@@ -1,14 +0,0 @@
1
- import { ComponentType } from "discord-api-types/v10";
2
- import { AnySelectMenuInteraction } from "./AnySelectMenuInteraction.js";
3
- export class UserSelectMenuInteraction extends AnySelectMenuInteraction {
4
- constructor(client, data) {
5
- super(client, data);
6
- if (data.data.component_type !== ComponentType.UserSelect) {
7
- throw new Error("Invalid component type was used to create this class");
8
- }
9
- }
10
- get values() {
11
- return this.rawData.data.values;
12
- }
13
- }
14
- //# sourceMappingURL=UserSelectMenuInteraction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UserSelectMenuInteraction.js","sourceRoot":"","sources":["../../../src/abstracts/UserSelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,aAAa,EACb,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAExE,MAAM,OAAO,yBAA0B,SAAQ,wBAAwB;IACtE,YAAY,MAAc,EAAE,IAA8C;QACzE,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QACnB,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,KAAK,aAAa,CAAC,UAAU,EAAE,CAAC;YAC3D,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;QACxE,CAAC;IACF,CAAC;IAED,IAAI,MAAM;QACT,OAAQ,IAAI,CAAC,OAAO,CAAC,IAA4C,CAAC,MAAM,CAAA;IACzE,CAAC;CACD"}
@@ -1,3 +0,0 @@
1
- export declare class Paginator {
2
- }
3
- //# sourceMappingURL=Paginator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Paginator.d.ts","sourceRoot":"","sources":["../../../src/classes/Paginator.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAS;CAGrB"}
@@ -1,3 +0,0 @@
1
- export class Paginator {
2
- }
3
- //# sourceMappingURL=Paginator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Paginator.js","sourceRoot":"","sources":["../../../src/classes/Paginator.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAS;CAGrB"}
@@ -1,17 +0,0 @@
1
- import type { APIMessageComponentInteraction } from "discord-api-types/v10";
2
- import { Base } from "../abstracts/Base.js";
3
- import type { BaseComponent } from "../abstracts/BaseComponent.js";
4
- export declare class ComponentHandler extends Base {
5
- components: BaseComponent[];
6
- /**
7
- * Register a component with the handler
8
- * @internal
9
- */
10
- registerComponent(component: BaseComponent): void;
11
- /**
12
- * Handle an interaction
13
- * @internal
14
- */
15
- handleInteraction(data: APIMessageComponentInteraction): Promise<false | undefined>;
16
- }
17
- //# sourceMappingURL=ComponentHandler%20copy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ComponentHandler copy.d.ts","sourceRoot":"","sources":["../../../src/internals/ComponentHandler copy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,8BAA8B,EAE9B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAclE,qBAAa,gBAAiB,SAAQ,IAAI;IACzC,UAAU,EAAE,aAAa,EAAE,CAAK;IAChC;;;OAGG;IACH,iBAAiB,CAAC,SAAS,EAAE,aAAa;IAK1C;;;OAGG;IACG,iBAAiB,CAAC,IAAI,EAAE,8BAA8B;CAwD5D"}
@@ -1,75 +0,0 @@
1
- import { Base } from "../abstracts/Base.js";
2
- import { Button } from "../classes/Button.js";
3
- import { ChannelSelectMenu } from "../classes/ChannelSelectMenu.js";
4
- import { MentionableSelectMenu } from "../classes/MentionableSelectMenu.js";
5
- import { RoleSelectMenu } from "../classes/RoleSelectMenu.js";
6
- import { StringSelectMenu } from "../classes/StringSelectMenu.js";
7
- import { UserSelectMenu } from "../classes/UserSelectMenu.js";
8
- import { ButtonInteraction } from "./ButtonInteraction.js";
9
- import { ChannelSelectMenuInteraction } from "./ChannelSelectMenuInteraction.js";
10
- import { MentionableSelectMenuInteraction } from "./MentionableSelectMenuInteraction.js";
11
- import { RoleSelectMenuInteraction } from "./RoleSelectMenuInteraction.js";
12
- import { StringSelectMenuInteraction } from "./StringSelectMenuInteraction.js";
13
- import { UserSelectMenuInteraction } from "./UserSelectMenuInteraction.js";
14
- export class ComponentHandler extends Base {
15
- components = [];
16
- /**
17
- * Register a component with the handler
18
- * @internal
19
- */
20
- registerComponent(component) {
21
- if (!this.components.find((x) => x.customId === component.customId)) {
22
- this.components.push(component);
23
- }
24
- }
25
- /**
26
- * Handle an interaction
27
- * @internal
28
- */
29
- async handleInteraction(data) {
30
- const component = this.components.find((x) => x.customId === data.data.custom_id &&
31
- x.type === data.data.component_type);
32
- if (!component)
33
- return false;
34
- if (component instanceof Button) {
35
- const interaction = new ButtonInteraction(this.client, data);
36
- if (component.defer)
37
- await interaction.defer();
38
- await component.run(interaction);
39
- }
40
- else if (component instanceof RoleSelectMenu) {
41
- const interaction = new RoleSelectMenuInteraction(this.client, data);
42
- if (component.defer)
43
- await interaction.defer();
44
- await component.run(interaction);
45
- }
46
- else if (component instanceof ChannelSelectMenu) {
47
- const interaction = new ChannelSelectMenuInteraction(this.client, data);
48
- if (component.defer)
49
- await interaction.defer();
50
- await component.run(interaction);
51
- }
52
- else if (component instanceof MentionableSelectMenu) {
53
- const interaction = new MentionableSelectMenuInteraction(this.client, data);
54
- if (component.defer)
55
- await interaction.defer();
56
- await component.run(interaction);
57
- }
58
- else if (component instanceof StringSelectMenu) {
59
- const interaction = new StringSelectMenuInteraction(this.client, data);
60
- if (component.defer)
61
- await interaction.defer();
62
- await component.run(interaction);
63
- }
64
- else if (component instanceof UserSelectMenu) {
65
- const interaction = new UserSelectMenuInteraction(this.client, data);
66
- if (component.defer)
67
- await interaction.defer();
68
- await component.run(interaction);
69
- }
70
- else {
71
- throw new Error(`Unknown component with type ${data.data.component_type} and custom ID ${data.data.custom_id}`);
72
- }
73
- }
74
- }
75
- //# sourceMappingURL=ComponentHandler%20copy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ComponentHandler copy.js","sourceRoot":"","sources":["../../../src/internals/ComponentHandler copy.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AAChF,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAA;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAE1E,MAAM,OAAO,gBAAiB,SAAQ,IAAI;IACzC,UAAU,GAAoB,EAAE,CAAA;IAChC;;;OAGG;IACH,iBAAiB,CAAC,SAAwB;QACzC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,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AC,WAAW,CAAC,CAAA;QACjC,CAAC;aAAM,IAAI,SAAS,YAAY,qBAAqB,EAAE,CAAC;YACvD,MAAM,WAAW,GAAG,IAAI,gCAAgC,CACvD,IAAI,CAAC,MAAM,EACX,IAAgD,CAChD,CAAA;YACD,IAAI,SAAS,CAAC,KAAK;gBAAE,MAAM,WAAW,CAAC,KAAK,EAAE,CAAA;YAC9C,MAAM,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QACjC,CAAC;aAAM,IAAI,SAAS,YAAY,gBAAgB,EAAE,CAAC;YAClD,MAAM,WAAW,GAAG,IAAI,2BAA2B,CAClD,IAAI,CAAC,MAAM,EACX,IAAgD,CAChD,CAAA;YACD,IAAI,SAAS,CAAC,KAAK;gBAAE,MAAM,WAAW,CAAC,KAAK,EAAE,CAAA;YAC9C,MAAM,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QACjC,CAAC;aAAM,IAAI,SAAS,YAAY,cAAc,EAAE,CAAC;YAChD,MAAM,WAAW,GAAG,IAAI,yBAAyB,CAChD,IAAI,CAAC,MAAM,EACX,IAAgD,CAChD,CAAA;YACD,IAAI,SAAS,CAAC,KAAK;gBAAE,MAAM,WAAW,CAAC,KAAK,EAAE,CAAA;YAC9C,MAAM,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QACjC,CAAC;aAAM,CAAC;YACP,MAAM,IAAI,KAAK,CACd,+BAA+B,IAAI,CAAC,IAAI,CAAC,cAAc,kBAAkB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAC9F,CAAA;QACF,CAAC;IACF,CAAC;CACD"}
@@ -1,31 +0,0 @@
1
- import type { APIChannelSelectComponent, APIMentionableSelectComponent, APIRoleSelectComponent, APISelectMenuComponent, APIStringSelectComponent, APIUserSelectComponent, ComponentType } from "discord-api-types/v10";
2
- import type { AnySelectMenuInteraction } from "./AnySelectMenuInteraction.js";
3
- import { BaseComponent } from "./BaseComponent.js";
4
- export type AnySelectMenuComponentType = ComponentType.ChannelSelect | ComponentType.RoleSelect | ComponentType.StringSelect | ComponentType.UserSelect | ComponentType.MentionableSelect;
5
- export declare abstract class AnySelectMenu extends BaseComponent {
6
- abstract type: AnySelectMenuComponentType;
7
- abstract run(interaction: AnySelectMenuInteraction): Promise<void>;
8
- minValues?: number;
9
- maxValues?: number;
10
- disabled?: boolean;
11
- placeholder?: string;
12
- serialize: () => APISelectMenuComponent;
13
- abstract serializeOptions(): {
14
- type: ComponentType.ChannelSelect;
15
- channel_types: APIChannelSelectComponent["channel_types"];
16
- default_values: APIChannelSelectComponent["default_values"];
17
- } | {
18
- type: ComponentType.StringSelect;
19
- options: APIStringSelectComponent["options"];
20
- } | {
21
- type: ComponentType.RoleSelect;
22
- default_values: APIRoleSelectComponent["default_values"];
23
- } | {
24
- type: ComponentType.UserSelect;
25
- default_values: APIUserSelectComponent["default_values"];
26
- } | {
27
- type: ComponentType.MentionableSelect;
28
- default_values: APIMentionableSelectComponent["default_values"];
29
- };
30
- }
31
- //# sourceMappingURL=AnySelectMenu.d.ts.map