@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.
- 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 +4 -0
- package/dist/src/abstracts/BaseInteraction.d.ts.map +1 -1
- package/dist/src/abstracts/BaseInteraction.js +4 -0
- 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/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,70 +0,0 @@
|
|
|
1
|
-
import { Base } from "./Base.js";
|
|
2
|
-
import { ApplicationCommandOptionType, ApplicationCommandType } from "discord-api-types/v10";
|
|
3
|
-
import { Command } from "../classes/Command.js";
|
|
4
|
-
import { CommandWithSubcommandGroups } from "../classes/CommandWithSubcommandGroups.js";
|
|
5
|
-
import { CommandWithSubcommands } from "../classes/CommandWithSubcommands.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
|
-
console.log(1);
|
|
15
|
-
if (command.defer) {
|
|
16
|
-
await interaction.defer();
|
|
17
|
-
}
|
|
18
|
-
console.log(2);
|
|
19
|
-
await command.run(interaction).then(() => {
|
|
20
|
-
console.log("2 done");
|
|
21
|
-
});
|
|
22
|
-
console.log(3);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (command instanceof CommandWithSubcommandGroups) {
|
|
26
|
-
if (rawInteraction.data.type !== ApplicationCommandType.ChatInput) {
|
|
27
|
-
return await interaction.reply({
|
|
28
|
-
content: "Subcommand groups must be used with ChatInput"
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
const data = rawInteraction.data;
|
|
32
|
-
const subcommandGroupName = data.options?.find((x) => x.type === ApplicationCommandOptionType.SubcommandGroup)?.name;
|
|
33
|
-
if (!subcommandGroupName)
|
|
34
|
-
return false;
|
|
35
|
-
const subcommandGroup = command.subcommandGroups.find((x) => x.name === subcommandGroupName);
|
|
36
|
-
if (!subcommandGroup)
|
|
37
|
-
return false;
|
|
38
|
-
const subcommandName = (data.options?.find((x) => x.type === ApplicationCommandOptionType.SubcommandGroup)).options?.find((x) => x.type === ApplicationCommandOptionType.Subcommand)?.name;
|
|
39
|
-
if (!subcommandName)
|
|
40
|
-
return false;
|
|
41
|
-
const subcommand = subcommandGroup.subcommands.find((x) => x.name === subcommandName);
|
|
42
|
-
if (!subcommand)
|
|
43
|
-
return false;
|
|
44
|
-
if (subcommand.defer) {
|
|
45
|
-
await interaction.defer();
|
|
46
|
-
}
|
|
47
|
-
return await subcommand.run(interaction);
|
|
48
|
-
}
|
|
49
|
-
if (command instanceof CommandWithSubcommands) {
|
|
50
|
-
if (rawInteraction.data.type !== ApplicationCommandType.ChatInput) {
|
|
51
|
-
return interaction.reply({
|
|
52
|
-
content: "Subcommands must be used with ChatInput"
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
const data = rawInteraction.data;
|
|
56
|
-
const subcommand = command.subcommands.find((x) => x.name === data.options?.[0]?.name);
|
|
57
|
-
if (!subcommand)
|
|
58
|
-
return false;
|
|
59
|
-
if (subcommand.defer) {
|
|
60
|
-
await interaction.defer();
|
|
61
|
-
}
|
|
62
|
-
return await subcommand.run(interaction);
|
|
63
|
-
}
|
|
64
|
-
console.error(`Command ${command.name} is not a valid command type`);
|
|
65
|
-
console.debug(rawInteraction.data
|
|
66
|
-
.options);
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=CommandHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommandHandler.js","sourceRoot":"","sources":["../../../src/structures/CommandHandler.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type APIApplicationCommandInteractionDataBasicOption, type APIApplicationCommandInteraction } 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 {
|
|
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/structures/CommandInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,+CAA+C,EAIpD,KAAK,gCAAgC,EACrC,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;IACtD,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/structures/CommandInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,4BAA4B,EAC5B,sBAAsB,EACtB,eAAe,EAEf,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,eAAe;IACtD,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;YAC9B,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,CAAA;YACvE,IAAI,CAAC,UAAU,EAAE,CAAC;gBACjB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,CAAA;YAChC,CAAC;iBAAM,CAAC;gBACP,QAAQ,UAAU,CAAC,IAAI,EAAE,CAAC;oBACzB,KAAK,4BAA4B,CAAC,MAAM;wBACvC,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,OAAO;wBACxC,MAAM,CAAC,MAAM,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 { Base } from "./Base.js";
|
|
2
|
-
import type { APIMessageComponentInteraction } from "discord-api-types/v10";
|
|
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/structures/ComponentHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,KAAK,EAEX,8BAA8B,EAE9B,MAAM,uBAAuB,CAAA;AAa9B,qBAAa,gBAAiB,SAAQ,IAAI;IACnC,iBAAiB,CAAC,IAAI,EAAE,8BAA8B;CA2D5D"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { Base } from "./Base.js";
|
|
2
|
-
import { Button } from "../classes/Button.js";
|
|
3
|
-
import { ButtonInteraction } from "./ButtonInteraction.js";
|
|
4
|
-
import { RoleSelectMenu } from "../classes/RoleSelectMenu.js";
|
|
5
|
-
import { ChannelSelectMenu } from "../classes/ChannelSelectMenu.js";
|
|
6
|
-
import { MentionableSelectMenu } from "../classes/MentionableSelectMenu.js";
|
|
7
|
-
import { StringSelectMenu } from "../classes/StringSelectMenu.js";
|
|
8
|
-
import { UserSelectMenu } from "../classes/UserSelectMenu.js";
|
|
9
|
-
import { RoleSelectMenuInteraction } from "./RoleSelectMenuInteraction.js";
|
|
10
|
-
import { UserSelectMenuInteraction } from "./UserSelectMenuInteraction.js";
|
|
11
|
-
import { StringSelectMenuInteraction } from "./StringSelectMenuInteraction.js";
|
|
12
|
-
import { MentionableSelectMenuInteraction } from "./MentionableSelectMenuInteraction.js";
|
|
13
|
-
import { ChannelSelectMenuInteraction } from "./ChannelSelectMenuInteraction.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/structures/ComponentHandler.ts"],"names":[],"mappings":"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"}
|
|
@@ -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/structures/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/structures/MentionableSelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,aAAa,EAEb,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/structures/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/structures/RoleSelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,aAAa,EAEb,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/structures/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/structures/StringSelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,aAAa,EAEb,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/structures/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/structures/UserSelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,aAAa,EAEb,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"}
|
package/dist/src/types.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* https://discord.com/developers/docs/resources/application#application-object-application-integration-types
|
|
3
|
-
*/
|
|
4
|
-
export declare enum ApplicationIntegrationType {
|
|
5
|
-
/**
|
|
6
|
-
* App is installable to servers
|
|
7
|
-
*/
|
|
8
|
-
GuildInstall = 0,
|
|
9
|
-
/**
|
|
10
|
-
* App is installable to users
|
|
11
|
-
*/
|
|
12
|
-
UserInstall = 1
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types
|
|
16
|
-
*/
|
|
17
|
-
export declare enum InteractionContextType {
|
|
18
|
-
/**
|
|
19
|
-
* Interaction can be used within servers
|
|
20
|
-
*/
|
|
21
|
-
Guild = 0,
|
|
22
|
-
/**
|
|
23
|
-
* Interaction can be used within DMs with the app's bot user
|
|
24
|
-
*/
|
|
25
|
-
BotDM = 1,
|
|
26
|
-
/**
|
|
27
|
-
* Interaction can be used within Group DMs and DMs other than the app's bot user
|
|
28
|
-
*/
|
|
29
|
-
PrivateChannel = 2
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/src/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,0BAA0B;IACrC;;OAEG;IACH,YAAY,IAAI;IAChB;;OAEG;IACH,WAAW,IAAI;CACf;AAED;;GAEG;AACH,oBAAY,sBAAsB;IACjC;;OAEG;IACH,KAAK,IAAI;IACT;;OAEG;IACH,KAAK,IAAI;IACT;;OAEG;IACH,cAAc,IAAI;CAClB"}
|
package/dist/src/types.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* https://discord.com/developers/docs/resources/application#application-object-application-integration-types
|
|
3
|
-
*/
|
|
4
|
-
export var ApplicationIntegrationType;
|
|
5
|
-
(function (ApplicationIntegrationType) {
|
|
6
|
-
/**
|
|
7
|
-
* App is installable to servers
|
|
8
|
-
*/
|
|
9
|
-
ApplicationIntegrationType[ApplicationIntegrationType["GuildInstall"] = 0] = "GuildInstall";
|
|
10
|
-
/**
|
|
11
|
-
* App is installable to users
|
|
12
|
-
*/
|
|
13
|
-
ApplicationIntegrationType[ApplicationIntegrationType["UserInstall"] = 1] = "UserInstall";
|
|
14
|
-
})(ApplicationIntegrationType || (ApplicationIntegrationType = {}));
|
|
15
|
-
/**
|
|
16
|
-
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types
|
|
17
|
-
*/
|
|
18
|
-
export var InteractionContextType;
|
|
19
|
-
(function (InteractionContextType) {
|
|
20
|
-
/**
|
|
21
|
-
* Interaction can be used within servers
|
|
22
|
-
*/
|
|
23
|
-
InteractionContextType[InteractionContextType["Guild"] = 0] = "Guild";
|
|
24
|
-
/**
|
|
25
|
-
* Interaction can be used within DMs with the app's bot user
|
|
26
|
-
*/
|
|
27
|
-
InteractionContextType[InteractionContextType["BotDM"] = 1] = "BotDM";
|
|
28
|
-
/**
|
|
29
|
-
* Interaction can be used within Group DMs and DMs other than the app's bot user
|
|
30
|
-
*/
|
|
31
|
-
InteractionContextType[InteractionContextType["PrivateChannel"] = 2] = "PrivateChannel";
|
|
32
|
-
})(InteractionContextType || (InteractionContextType = {}));
|
|
33
|
-
//# sourceMappingURL=types.js.map
|
package/dist/src/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,0BASX;AATD,WAAY,0BAA0B;IACrC;;OAEG;IACH,2FAAgB,CAAA;IAChB;;OAEG;IACH,yFAAe,CAAA;AAChB,CAAC,EATW,0BAA0B,KAA1B,0BAA0B,QASrC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,sBAaX;AAbD,WAAY,sBAAsB;IACjC;;OAEG;IACH,qEAAS,CAAA;IACT;;OAEG;IACH,qEAAS,CAAA;IACT;;OAEG;IACH,uFAAkB,CAAA;AACnB,CAAC,EAbW,sBAAsB,KAAtB,sBAAsB,QAajC"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: AnySelectMenu
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
## Extends
|
|
6
|
-
|
|
7
|
-
- [`BaseComponent`](/carbon/api/classes/BaseComponent)
|
|
8
|
-
|
|
9
|
-
## Extended by
|
|
10
|
-
|
|
11
|
-
- [`ChannelSelectMenu`](/carbon/api/classes/ChannelSelectMenu)
|
|
12
|
-
- [`MentionableSelectMenu`](/carbon/api/classes/MentionableSelectMenu)
|
|
13
|
-
- [`RoleSelectMenu`](/carbon/api/classes/RoleSelectMenu)
|
|
14
|
-
- [`StringSelectMenu`](/carbon/api/classes/StringSelectMenu)
|
|
15
|
-
- [`UserSelectMenu`](/carbon/api/classes/UserSelectMenu)
|
|
16
|
-
|
|
17
|
-
## Constructors
|
|
18
|
-
|
|
19
|
-
### new AnySelectMenu()
|
|
20
|
-
|
|
21
|
-
> **new AnySelectMenu**(`data`?): [`AnySelectMenu`](/carbon/api/classes/AnySelectMenu)
|
|
22
|
-
|
|
23
|
-
#### Parameters
|
|
24
|
-
|
|
25
|
-
| Parameter | Type |
|
|
26
|
-
| ------ | ------ |
|
|
27
|
-
| `data`? | `object` |
|
|
28
|
-
| `data.additionalData`? | [`ComponentAdditionalData`](/carbon/api/type-aliases/ComponentAdditionalData) |
|
|
29
|
-
|
|
30
|
-
#### Returns
|
|
31
|
-
|
|
32
|
-
[`AnySelectMenu`](/carbon/api/classes/AnySelectMenu)
|
|
33
|
-
|
|
34
|
-
#### Inherited from
|
|
35
|
-
|
|
36
|
-
[`BaseComponent`](/carbon/api/classes/BaseComponent).[`constructor`](/carbon/api/classes/BaseComponent#constructors)
|
|
37
|
-
|
|
38
|
-
## Properties
|
|
39
|
-
|
|
40
|
-
| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |
|
|
41
|
-
| ------ | ------ | ------ | ------ | ------ | ------ | ------ |
|
|
42
|
-
| `additionalData` | `public` | `null` \| [`ComponentAdditionalData`](/carbon/api/type-aliases/ComponentAdditionalData) | `null` | - | - | [`BaseComponent`](/carbon/api/classes/BaseComponent).`additionalData` |
|
|
43
|
-
| `customId` | `abstract` | `string` | `undefined` | The custom ID of the component | - | [`BaseComponent`](/carbon/api/classes/BaseComponent).`customId` |
|
|
44
|
-
| `defer` | `public` | `boolean` | `false` | Whether the component response should be automatically deferred | - | [`BaseComponent`](/carbon/api/classes/BaseComponent).`defer` |
|
|
45
|
-
| `disabled?` | `public` | `boolean` | `undefined` | - | - | - |
|
|
46
|
-
| `ephemeral` | `public` | `boolean` | `false` | Whether the component response should be ephemeral | - | [`BaseComponent`](/carbon/api/classes/BaseComponent).`ephemeral` |
|
|
47
|
-
| `maxValues?` | `public` | `number` | `undefined` | - | - | - |
|
|
48
|
-
| `minValues?` | `public` | `number` | `undefined` | - | - | - |
|
|
49
|
-
| `placeholder?` | `public` | `string` | `undefined` | - | - | - |
|
|
50
|
-
| `type` | `abstract` | [`AnySelectMenuComponentType`](/carbon/api/type-aliases/AnySelectMenuComponentType) | `undefined` | The type of the component | [`BaseComponent`](/carbon/api/classes/BaseComponent).`type` | - |
|
|
51
|
-
|
|
52
|
-
## Methods
|
|
53
|
-
|
|
54
|
-
### createId()
|
|
55
|
-
|
|
56
|
-
> **createId**(`additionalData`): `string`
|
|
57
|
-
|
|
58
|
-
Create a custom ID to use for this component that embeds additional data that you want to be handed
|
|
59
|
-
|
|
60
|
-
#### Parameters
|
|
61
|
-
|
|
62
|
-
| Parameter | Type | Description |
|
|
63
|
-
| ------ | ------ | ------ |
|
|
64
|
-
| `additionalData` | `null` \| [`ComponentAdditionalData`](/carbon/api/type-aliases/ComponentAdditionalData) | The additional data that you want to be passed in this component's custom ID |
|
|
65
|
-
|
|
66
|
-
#### Returns
|
|
67
|
-
|
|
68
|
-
`string`
|
|
69
|
-
|
|
70
|
-
The custom ID to use
|
|
71
|
-
|
|
72
|
-
#### Inherited from
|
|
73
|
-
|
|
74
|
-
[`BaseComponent`](/carbon/api/classes/BaseComponent).[`createId`](/carbon/api/classes/BaseComponent#createid)
|
|
75
|
-
|
|
76
|
-
***
|
|
77
|
-
|
|
78
|
-
### run()
|
|
79
|
-
|
|
80
|
-
> `abstract` **run**(`interaction`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\>
|
|
81
|
-
|
|
82
|
-
#### Parameters
|
|
83
|
-
|
|
84
|
-
| Parameter | Type |
|
|
85
|
-
| ------ | ------ |
|
|
86
|
-
| `interaction` | [`AnySelectMenuInteraction`](/carbon/api/classes/AnySelectMenuInteraction) |
|
|
87
|
-
|
|
88
|
-
#### Returns
|
|
89
|
-
|
|
90
|
-
[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\>
|
|
91
|
-
|
|
92
|
-
***
|
|
93
|
-
|
|
94
|
-
### serialize()
|
|
95
|
-
|
|
96
|
-
> **serialize**(): `APISelectMenuComponent`
|
|
97
|
-
|
|
98
|
-
#### Returns
|
|
99
|
-
|
|
100
|
-
`APISelectMenuComponent`
|
|
101
|
-
|
|
102
|
-
#### Overrides
|
|
103
|
-
|
|
104
|
-
`BaseComponent.serialize`
|
|
105
|
-
|
|
106
|
-
***
|
|
107
|
-
|
|
108
|
-
### serializeOptions()
|
|
109
|
-
|
|
110
|
-
> `abstract` **serializeOptions**(): `object` \| `object` \| `object` \| `object` \| `object`
|
|
111
|
-
|
|
112
|
-
#### Returns
|
|
113
|
-
|
|
114
|
-
`object` \| `object` \| `object` \| `object` \| `object`
|