@buape/carbon 0.2.0 → 0.3.1
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.
- package/dist/package.json +7 -2
- package/dist/src/abstracts/BaseComponentInteraction.d.ts +6 -1
- package/dist/src/abstracts/BaseComponentInteraction.d.ts.map +1 -1
- package/dist/src/abstracts/BaseComponentInteraction.js +12 -0
- package/dist/src/abstracts/BaseComponentInteraction.js.map +1 -1
- package/dist/src/abstracts/BaseInteraction.d.ts +10 -1
- package/dist/src/abstracts/BaseInteraction.d.ts.map +1 -1
- package/dist/src/abstracts/BaseInteraction.js +10 -1
- package/dist/src/abstracts/BaseInteraction.js.map +1 -1
- package/dist/src/classes/Client.d.ts.map +1 -1
- package/dist/src/classes/Client.js +21 -11
- package/dist/src/classes/Client.js.map +1 -1
- package/dist/src/classes/Embed.d.ts +60 -0
- package/dist/src/classes/Embed.d.ts.map +1 -0
- package/dist/src/classes/Embed.js +73 -0
- package/dist/src/classes/Embed.js.map +1 -0
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/internals/AutocompleteInteraction.d.ts +1 -1
- package/dist/src/internals/FieldsHandler.d.ts +27 -0
- package/dist/src/internals/FieldsHandler.d.ts.map +1 -0
- package/dist/src/internals/FieldsHandler.js +37 -0
- package/dist/src/internals/FieldsHandler.js.map +1 -0
- package/dist/src/internals/ModalInteraction.d.ts +3 -4
- package/dist/src/internals/ModalInteraction.d.ts.map +1 -1
- package/dist/src/internals/ModalInteraction.js +3 -10
- package/dist/src/internals/ModalInteraction.js.map +1 -1
- package/dist/src/internals/OptionsHandler.d.ts +33 -17
- package/dist/src/internals/OptionsHandler.d.ts.map +1 -1
- package/dist/src/internals/OptionsHandler.js +52 -58
- package/dist/src/internals/OptionsHandler.js.map +1 -1
- package/dist/src/utils.d.ts +3 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +54 -0
- package/dist/src/utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -1
- package/.turbo/turbo-build.log +0 -5
- package/.turbo/turbo-dev.log +0 -8
- package/.turbo/turbo-docs.log +0 -12
- package/CHANGELOG.md +0 -44
- package/dist/src/abstracts/ButtonInteraction.d.ts +0 -8
- package/dist/src/abstracts/ButtonInteraction.d.ts.map +0 -1
- package/dist/src/abstracts/ButtonInteraction.js +0 -18
- package/dist/src/abstracts/ButtonInteraction.js.map +0 -1
- package/dist/src/abstracts/ChannelSelectMenuInteraction.d.ts +0 -7
- package/dist/src/abstracts/ChannelSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/abstracts/ChannelSelectMenuInteraction.js +0 -11
- package/dist/src/abstracts/ChannelSelectMenuInteraction.js.map +0 -1
- package/dist/src/abstracts/CommandHandler.d.ts +0 -6
- package/dist/src/abstracts/CommandHandler.d.ts.map +0 -1
- package/dist/src/abstracts/CommandHandler.js +0 -65
- package/dist/src/abstracts/CommandHandler.js.map +0 -1
- package/dist/src/abstracts/CommandInteraction.d.ts +0 -15
- package/dist/src/abstracts/CommandInteraction.d.ts.map +0 -1
- package/dist/src/abstracts/CommandInteraction.js +0 -60
- package/dist/src/abstracts/CommandInteraction.js.map +0 -1
- package/dist/src/abstracts/ComponentHandler.d.ts +0 -6
- package/dist/src/abstracts/ComponentHandler.d.ts.map +0 -1
- package/dist/src/abstracts/ComponentHandler.js +0 -64
- package/dist/src/abstracts/ComponentHandler.js.map +0 -1
- package/dist/src/abstracts/MentionableSelectMenuInteraction.d.ts +0 -8
- package/dist/src/abstracts/MentionableSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/abstracts/MentionableSelectMenuInteraction.js +0 -15
- package/dist/src/abstracts/MentionableSelectMenuInteraction.js.map +0 -1
- package/dist/src/abstracts/RoleSelectMenuInteraction.d.ts +0 -8
- package/dist/src/abstracts/RoleSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/abstracts/RoleSelectMenuInteraction.js +0 -14
- package/dist/src/abstracts/RoleSelectMenuInteraction.js.map +0 -1
- package/dist/src/abstracts/StringSelectMenuInteraction.d.ts +0 -8
- package/dist/src/abstracts/StringSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/abstracts/StringSelectMenuInteraction.js +0 -14
- package/dist/src/abstracts/StringSelectMenuInteraction.js.map +0 -1
- package/dist/src/abstracts/UserSelectMenuInteraction.d.ts +0 -8
- package/dist/src/abstracts/UserSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/abstracts/UserSelectMenuInteraction.js +0 -14
- package/dist/src/abstracts/UserSelectMenuInteraction.js.map +0 -1
- package/dist/src/classes/Paginator.d.ts +0 -3
- package/dist/src/classes/Paginator.d.ts.map +0 -1
- package/dist/src/classes/Paginator.js +0 -3
- package/dist/src/classes/Paginator.js.map +0 -1
- package/dist/src/internals/ComponentHandler copy.d.ts +0 -17
- package/dist/src/internals/ComponentHandler copy.d.ts.map +0 -1
- package/dist/src/internals/ComponentHandler copy.js +0 -75
- package/dist/src/internals/ComponentHandler copy.js.map +0 -1
- package/dist/src/structures/AnySelectMenu.d.ts +0 -31
- package/dist/src/structures/AnySelectMenu.d.ts.map +0 -1
- package/dist/src/structures/AnySelectMenu.js +0 -19
- package/dist/src/structures/AnySelectMenu.js.map +0 -1
- package/dist/src/structures/AnySelectMenuInteraction.d.ts +0 -12
- package/dist/src/structures/AnySelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/structures/AnySelectMenuInteraction.js +0 -21
- package/dist/src/structures/AnySelectMenuInteraction.js.map +0 -1
- package/dist/src/structures/Base.d.ts +0 -10
- package/dist/src/structures/Base.d.ts.map +0 -1
- package/dist/src/structures/Base.js +0 -11
- package/dist/src/structures/Base.js.map +0 -1
- package/dist/src/structures/BaseCommand.d.ts +0 -64
- package/dist/src/structures/BaseCommand.d.ts.map +0 -1
- package/dist/src/structures/BaseCommand.js +0 -58
- package/dist/src/structures/BaseCommand.js.map +0 -1
- package/dist/src/structures/BaseComponent.d.ts +0 -34
- package/dist/src/structures/BaseComponent.d.ts.map +0 -1
- package/dist/src/structures/BaseComponent.js +0 -30
- package/dist/src/structures/BaseComponent.js.map +0 -1
- package/dist/src/structures/BaseComponentInteraction.d.ts +0 -9
- package/dist/src/structures/BaseComponentInteraction.d.ts.map +0 -1
- package/dist/src/structures/BaseComponentInteraction.js +0 -14
- package/dist/src/structures/BaseComponentInteraction.js.map +0 -1
- package/dist/src/structures/BaseInteraction.d.ts +0 -81
- package/dist/src/structures/BaseInteraction.d.ts.map +0 -1
- package/dist/src/structures/BaseInteraction.js +0 -99
- package/dist/src/structures/BaseInteraction.js.map +0 -1
- package/dist/src/structures/ButtonInteraction.d.ts +0 -8
- package/dist/src/structures/ButtonInteraction.d.ts.map +0 -1
- package/dist/src/structures/ButtonInteraction.js +0 -18
- package/dist/src/structures/ButtonInteraction.js.map +0 -1
- package/dist/src/structures/ChannelSelectMenuInteraction.d.ts +0 -7
- package/dist/src/structures/ChannelSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/structures/ChannelSelectMenuInteraction.js +0 -11
- package/dist/src/structures/ChannelSelectMenuInteraction.js.map +0 -1
- package/dist/src/structures/CommandHandler.d.ts +0 -6
- package/dist/src/structures/CommandHandler.d.ts.map +0 -1
- package/dist/src/structures/CommandHandler.js +0 -70
- package/dist/src/structures/CommandHandler.js.map +0 -1
- package/dist/src/structures/CommandInteraction.d.ts +0 -15
- package/dist/src/structures/CommandInteraction.d.ts.map +0 -1
- package/dist/src/structures/CommandInteraction.js +0 -60
- package/dist/src/structures/CommandInteraction.js.map +0 -1
- package/dist/src/structures/ComponentHandler.d.ts +0 -6
- package/dist/src/structures/ComponentHandler.d.ts.map +0 -1
- package/dist/src/structures/ComponentHandler.js +0 -64
- package/dist/src/structures/ComponentHandler.js.map +0 -1
- package/dist/src/structures/MentionableSelectMenuInteraction.d.ts +0 -8
- package/dist/src/structures/MentionableSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/structures/MentionableSelectMenuInteraction.js +0 -15
- package/dist/src/structures/MentionableSelectMenuInteraction.js.map +0 -1
- package/dist/src/structures/RoleSelectMenuInteraction.d.ts +0 -8
- package/dist/src/structures/RoleSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/structures/RoleSelectMenuInteraction.js +0 -14
- package/dist/src/structures/RoleSelectMenuInteraction.js.map +0 -1
- package/dist/src/structures/StringSelectMenuInteraction.d.ts +0 -8
- package/dist/src/structures/StringSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/structures/StringSelectMenuInteraction.js +0 -14
- package/dist/src/structures/StringSelectMenuInteraction.js.map +0 -1
- package/dist/src/structures/UserSelectMenuInteraction.d.ts +0 -8
- package/dist/src/structures/UserSelectMenuInteraction.d.ts.map +0 -1
- package/dist/src/structures/UserSelectMenuInteraction.js +0 -14
- package/dist/src/structures/UserSelectMenuInteraction.js.map +0 -1
- package/dist/src/types.d.ts +0 -31
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -33
- package/dist/src/types.js.map +0 -1
- package/docs/classes/AnySelectMenu.mdx +0 -114
- package/docs/classes/AnySelectMenuInteraction.mdx +0 -175
- package/docs/classes/AutocompleteInteraction.mdx +0 -166
- package/docs/classes/AutocompleteOptionsHandler.mdx +0 -243
- package/docs/classes/BaseChannel.mdx +0 -97
- package/docs/classes/BaseCommand.mdx +0 -61
- package/docs/classes/BaseComponent.mdx +0 -55
- package/docs/classes/BaseComponentInteraction.mdx +0 -160
- package/docs/classes/BaseGuildChannel.mdx +0 -262
- package/docs/classes/BaseGuildTextChannel.mdx +0 -360
- package/docs/classes/BaseInteraction.mdx +0 -137
- package/docs/classes/Button.mdx +0 -99
- package/docs/classes/ButtonInteraction.mdx +0 -155
- package/docs/classes/ChannelSelectMenu.mdx +0 -122
- package/docs/classes/ChannelSelectMenuInteraction.mdx +0 -171
- package/docs/classes/Client.mdx +0 -48
- package/docs/classes/Command.mdx +0 -111
- package/docs/classes/CommandHandler.mdx +0 -65
- package/docs/classes/CommandInteraction.mdx +0 -155
- package/docs/classes/CommandWithSubcommandGroups.mdx +0 -73
- package/docs/classes/CommandWithSubcommands.mdx +0 -76
- package/docs/classes/ComponentHandler.mdx +0 -49
- package/docs/classes/DmChannel.mdx +0 -118
- package/docs/classes/GroupDmChannel.mdx +0 -197
- package/docs/classes/Guild.mdx +0 -157
- package/docs/classes/GuildAnnouncementChannel.mdx +0 -377
- package/docs/classes/GuildCategoryChannel.mdx +0 -272
- package/docs/classes/GuildForumChannel.mdx +0 -333
- package/docs/classes/GuildMediaChannel.mdx +0 -327
- package/docs/classes/GuildStageChannel.mdx +0 -276
- package/docs/classes/GuildStageOrVoiceChannel.mdx +0 -292
- package/docs/classes/GuildTextChannel.mdx +0 -367
- package/docs/classes/GuildThreadChannel.mdx +0 -425
- package/docs/classes/GuildThreadOnlyChannel.mdx +0 -333
- package/docs/classes/GuildVoiceChannel.mdx +0 -276
- package/docs/classes/LinkButton.mdx +0 -84
- package/docs/classes/MentionableSelectMenu.mdx +0 -120
- package/docs/classes/MentionableSelectMenuInteraction.mdx +0 -171
- package/docs/classes/Message.mdx +0 -126
- package/docs/classes/OptionsHandler.mdx +0 -203
- package/docs/classes/PremiumButton.mdx +0 -84
- package/docs/classes/Role.mdx +0 -228
- package/docs/classes/RoleSelectMenu.mdx +0 -120
- package/docs/classes/RoleSelectMenuInteraction.mdx +0 -171
- package/docs/classes/Row.mdx +0 -88
- package/docs/classes/StringSelectMenu.mdx +0 -120
- package/docs/classes/StringSelectMenuInteraction.mdx +0 -171
- package/docs/classes/User.mdx +0 -119
- package/docs/classes/UserSelectMenu.mdx +0 -120
- package/docs/classes/UserSelectMenuInteraction.mdx +0 -171
- package/docs/enumerations/ClientMode.mdx +0 -16
- package/docs/functions/channelFactory.mdx +0 -16
- package/docs/index.mdx +0 -83
- package/docs/type-aliases/AnySelectMenuComponentType.mdx +0 -5
- package/docs/type-aliases/ClientOptions.mdx +0 -20
- package/docs/type-aliases/CommandOptions.mdx +0 -5
- package/docs/type-aliases/ComponentAdditionalData.mdx +0 -9
- package/docs/type-aliases/InteractionFileData.mdx +0 -15
- package/docs/type-aliases/InteractionReplyData.mdx +0 -14
- package/docs/type-aliases/InteractionReplyOptions.mdx +0 -13
- package/docs/type-aliases/RawOptions.mdx +0 -9
- package/docs/type-aliases/meta.json +0 -3
- package/src/README.md +0 -7
- package/src/abstracts/AnySelectMenu.ts +0 -63
- package/src/abstracts/AnySelectMenuInteraction.ts +0 -29
- package/src/abstracts/Base.ts +0 -12
- package/src/abstracts/BaseChannel.ts +0 -73
- package/src/abstracts/BaseCommand.ts +0 -89
- package/src/abstracts/BaseComponent.ts +0 -49
- package/src/abstracts/BaseComponentInteraction.ts +0 -19
- package/src/abstracts/BaseGuildChannel.ts +0 -152
- package/src/abstracts/BaseGuildTextChannel.ts +0 -77
- package/src/abstracts/BaseInteraction.ts +0 -209
- package/src/abstracts/GuildThreadOnlyChannel.ts +0 -71
- package/src/classes/Button.ts +0 -95
- package/src/classes/ChannelSelectMenu.ts +0 -21
- package/src/classes/Client.ts +0 -277
- package/src/classes/Command.ts +0 -53
- package/src/classes/CommandWithSubcommandGroups.ts +0 -47
- package/src/classes/CommandWithSubcommands.ts +0 -35
- package/src/classes/MentionableSelectMenu.ts +0 -19
- package/src/classes/Modal.ts +0 -38
- package/src/classes/RoleSelectMenu.ts +0 -19
- package/src/classes/Row.ts +0 -50
- package/src/classes/StringSelectMenu.ts +0 -19
- package/src/classes/TextInput.ts +0 -65
- package/src/classes/UserSelectMenu.ts +0 -19
- package/src/factories/channelFactory.ts +0 -43
- package/src/index.ts +0 -62
- package/src/internals/AutocompleteInteraction.ts +0 -107
- package/src/internals/ButtonInteraction.ts +0 -26
- package/src/internals/ChannelSelectMenuInteraction.ts +0 -15
- package/src/internals/CommandHandler.ts +0 -127
- package/src/internals/CommandInteraction.ts +0 -49
- package/src/internals/ComponentHandler.ts +0 -92
- package/src/internals/MentionableSelectMenuInteraction.ts +0 -21
- package/src/internals/ModalHandler.ts +0 -27
- package/src/internals/ModalInteraction.ts +0 -25
- package/src/internals/OptionsHandler.ts +0 -148
- package/src/internals/RoleSelectMenuInteraction.ts +0 -20
- package/src/internals/StringSelectMenuInteraction.ts +0 -20
- package/src/internals/UserSelectMenuInteraction.ts +0 -20
- package/src/structures/DmChannel.ts +0 -31
- package/src/structures/GroupDmChannel.ts +0 -132
- package/src/structures/Guild.ts +0 -154
- package/src/structures/GuildAnnouncementChannel.ts +0 -20
- package/src/structures/GuildCategoryChannel.ts +0 -16
- package/src/structures/GuildForumChannel.ts +0 -20
- package/src/structures/GuildMediaChannel.ts +0 -13
- package/src/structures/GuildMember.ts +0 -231
- package/src/structures/GuildStageOrVoiceChannel.ts +0 -46
- package/src/structures/GuildTextChannel.ts +0 -21
- package/src/structures/GuildThreadChannel.ts +0 -150
- package/src/structures/Message.ts +0 -124
- package/src/structures/Role.ts +0 -201
- package/src/structures/User.ts +0 -153
- package/src/utils.ts +0 -13
- package/tests/index.test.ts +0 -4
- package/tsconfig.json +0 -12
- package/typedoc.json +0 -9
|
@@ -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,EAAE,CAAA;YAC1B,CAAC;YACD,MAAM,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;YA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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,EAAE,CAAC;YACtD,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;QAC1E,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,sBAAsB,CAAC,SAAS,EAAE,CAAC;YACzD,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAA;QACtE,CAAC;QACD,IACC,OAAO;YACP,OAAO,YAAY,OAAO;YAC1B,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,sBAAsB,CAAC,SAAS,EAClD,CAAC;YACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAC/B,OAAO,EACP,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO;gBACjB,EAAE,CAAsD,CACzD,CAAA;QACF,CAAC;IACF,CAAC;IAEO,YAAY,GAAG,CACtB,OAAgB,EAChB,OAA0D,EACzD,EAAE;QACH,MAAM,MAAM,GAER,EAAE,CAAA;QACN,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC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}
|
|
@@ -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,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ChD,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,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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Paginator.d.ts","sourceRoot":"","sources":["../../../src/classes/Paginator.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAS;CAGrB"}
|
|
@@ -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,mCAAm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,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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AnySelectMenu.d.ts","sourceRoot":"","sources":["../../../src/structures/AnySelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,yBAAyB,EACzB,6BAA6B,EAC7B,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,MAAM,MAAM,0BAA0B,GACnC,aAAa,CAAC,aAAa,GAC3B,aAAa,CAAC,UAAU,GACxB,aAAa,CAAC,YAAY,GAC1B,aAAa,CAAC,UAAU,GACxB,aAAa,CAAC,iBAAiB,CAAA;AAElC,8BAAsB,aAAc,SAAQ,aAAa;IACxD,QAAQ,CAAC,IAAI,EAAE,0BAA0B,CAAA;IACzC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAElE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,SAAS,QAAO,sBAAsB,CAUrC;IAED,QAAQ,CAAC,gBAAgB,IACtB;QACA,IAAI,EAAE,aAAa,CAAC,aAAa,CAAA;QACjC,aAAa,EAAE,yBAAyB,CAAC,eAAe,CAAC,CAAA;QACzD,cAAc,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,CAAA;KAC1D,GACD;QACA,IAAI,EAAE,aAAa,CAAC,YAAY,CAAA;QAChC,OAAO,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAA;KAC3C,GACD;QACA,IAAI,EAAE,aAAa,CAAC,UAAU,CAAA;QAC9B,cAAc,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,CAAA;KACvD,GACD;QACA,IAAI,EAAE,aAAa,CAAC,UAAU,CAAA;QAC9B,cAAc,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,CAAA;KACvD,GACD;QACA,IAAI,EAAE,aAAa,CAAC,iBAAiB,CAAA;QACrC,cAAc,EAAE,6BAA6B,CAAC,gBAAgB,CAAC,CAAA;KAC9D;CACJ"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { BaseComponent } from "./BaseComponent.js";
|
|
2
|
-
export class AnySelectMenu extends BaseComponent {
|
|
3
|
-
minValues;
|
|
4
|
-
maxValues;
|
|
5
|
-
disabled;
|
|
6
|
-
placeholder;
|
|
7
|
-
serialize = () => {
|
|
8
|
-
const options = this.serializeOptions();
|
|
9
|
-
return {
|
|
10
|
-
...options,
|
|
11
|
-
custom_id: this.customId,
|
|
12
|
-
disabled: this.disabled,
|
|
13
|
-
placeholder: this.placeholder,
|
|
14
|
-
min_values: this.minValues,
|
|
15
|
-
max_values: this.maxValues
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=AnySelectMenu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AnySelectMenu.js","sourceRoot":"","sources":["../../../src/structures/AnySelectMenu.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AASlD,MAAM,OAAgB,aAAc,SAAQ,aAAa;IAIxD,SAAS,CAAS;IAClB,SAAS,CAAS;IAClB,QAAQ,CAAU;IAClB,WAAW,CAAS;IAEpB,SAAS,GAAG,GAA2B,EAAE;QACxC,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAA;QACvC,OAAO;YACN,GAAG,OAAO;YACV,SAAS,EAAE,IAAI,CAAC,QAAQ;YACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,UAAU,EAAE,IAAI,CAAC,SAAS;YAC1B,UAAU,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAA;IACF,CAAC,CAAA;CAwBD"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type APIMessageComponentSelectMenuInteraction } from "discord-api-types/v10";
|
|
2
|
-
import type { Client } from "../classes/Client.js";
|
|
3
|
-
import { BaseComponentInteraction } from "./BaseComponentInteraction.js";
|
|
4
|
-
export declare abstract class AnySelectMenuInteraction extends BaseComponentInteraction {
|
|
5
|
-
customId: string;
|
|
6
|
-
constructor(client: Client, data: APIMessageComponentSelectMenuInteraction);
|
|
7
|
-
/**
|
|
8
|
-
* The raw IDs of the selected options (either role/string/channel IDs or the IDs you provided in your options)
|
|
9
|
-
*/
|
|
10
|
-
get values(): string[];
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=AnySelectMenuInteraction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AnySelectMenuInteraction.d.ts","sourceRoot":"","sources":["../../../src/structures/AnySelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,wCAAwC,EAC7C,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAGxE,8BAAsB,wBAAyB,SAAQ,wBAAwB;IAC9E,QAAQ,EAAE,MAAM,CAEZ;gBACQ,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,wCAAwC;IAS1E;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,EAAE,CAErB;CACD"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { InteractionType } from "discord-api-types/v10";
|
|
2
|
-
import { BaseComponentInteraction } from "./BaseComponentInteraction.js";
|
|
3
|
-
import { splitCustomId } from "../utils.js";
|
|
4
|
-
export class AnySelectMenuInteraction 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
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* The raw IDs of the selected options (either role/string/channel IDs or the IDs you provided in your options)
|
|
16
|
-
*/
|
|
17
|
-
get values() {
|
|
18
|
-
return this.rawData.data.values;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=AnySelectMenuInteraction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AnySelectMenuInteraction.js","sourceRoot":"","sources":["../../../src/structures/AnySelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EAGf,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,OAAgB,wBAAyB,SAAQ,wBAAwB;IAC9E,QAAQ,GAAW,aAAa,CAC9B,IAAI,CAAC,OAAO,CAAC,IAA4C,CAAC,SAAS,CACpE,CAAC,CAAC,CAAC,CAAA;IACJ,YAAY,MAAc,EAAE,IAA8C;QACzE,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;IACF,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACT,OAAQ,IAAI,CAAC,OAAO,CAAC,IAA4C,CAAC,MAAM,CAAA;IACzE,CAAC;CACD"}
|