@buape/carbon 0.0.0-beta-20241008010229
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/LICENSE +21 -0
- package/README.md +52 -0
- package/dist/package.json +34 -0
- package/dist/src/abstracts/AnySelectMenu.d.ts +31 -0
- package/dist/src/abstracts/AnySelectMenu.d.ts.map +1 -0
- package/dist/src/abstracts/AnySelectMenu.js +19 -0
- package/dist/src/abstracts/AnySelectMenu.js.map +1 -0
- package/dist/src/abstracts/AnySelectMenuInteraction.d.ts +13 -0
- package/dist/src/abstracts/AnySelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/AnySelectMenuInteraction.js +21 -0
- package/dist/src/abstracts/AnySelectMenuInteraction.js.map +1 -0
- package/dist/src/abstracts/Base.d.ts +10 -0
- package/dist/src/abstracts/Base.d.ts.map +1 -0
- package/dist/src/abstracts/Base.js +11 -0
- package/dist/src/abstracts/Base.js.map +1 -0
- package/dist/src/abstracts/BaseChannel.d.ts +45 -0
- package/dist/src/abstracts/BaseChannel.d.ts.map +1 -0
- package/dist/src/abstracts/BaseChannel.js +68 -0
- package/dist/src/abstracts/BaseChannel.js.map +1 -0
- package/dist/src/abstracts/BaseCommand.d.ts +58 -0
- package/dist/src/abstracts/BaseCommand.d.ts.map +1 -0
- package/dist/src/abstracts/BaseCommand.js +72 -0
- package/dist/src/abstracts/BaseCommand.js.map +1 -0
- package/dist/src/abstracts/BaseComponent.d.ts +34 -0
- package/dist/src/abstracts/BaseComponent.d.ts.map +1 -0
- package/dist/src/abstracts/BaseComponent.js +30 -0
- package/dist/src/abstracts/BaseComponent.js.map +1 -0
- package/dist/src/abstracts/BaseComponentInteraction.d.ts +19 -0
- package/dist/src/abstracts/BaseComponentInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/BaseComponentInteraction.js +42 -0
- package/dist/src/abstracts/BaseComponentInteraction.js.map +1 -0
- package/dist/src/abstracts/BaseGuildChannel.d.ts +70 -0
- package/dist/src/abstracts/BaseGuildChannel.d.ts.map +1 -0
- package/dist/src/abstracts/BaseGuildChannel.js +143 -0
- package/dist/src/abstracts/BaseGuildChannel.js.map +1 -0
- package/dist/src/abstracts/BaseGuildTextChannel.d.ts +46 -0
- package/dist/src/abstracts/BaseGuildTextChannel.d.ts.map +1 -0
- package/dist/src/abstracts/BaseGuildTextChannel.js +77 -0
- package/dist/src/abstracts/BaseGuildTextChannel.js.map +1 -0
- package/dist/src/abstracts/BaseInteraction.d.ts +92 -0
- package/dist/src/abstracts/BaseInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/BaseInteraction.js +152 -0
- package/dist/src/abstracts/BaseInteraction.js.map +1 -0
- package/dist/src/abstracts/GuildThreadOnlyChannel.d.ts +43 -0
- package/dist/src/abstracts/GuildThreadOnlyChannel.d.ts.map +1 -0
- package/dist/src/abstracts/GuildThreadOnlyChannel.js +69 -0
- package/dist/src/abstracts/GuildThreadOnlyChannel.js.map +1 -0
- package/dist/src/classes/Button.d.ts +49 -0
- package/dist/src/classes/Button.d.ts.map +1 -0
- package/dist/src/classes/Button.js +61 -0
- package/dist/src/classes/Button.js.map +1 -0
- package/dist/src/classes/ChannelSelectMenu.d.ts +15 -0
- package/dist/src/classes/ChannelSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/ChannelSelectMenu.js +15 -0
- package/dist/src/classes/ChannelSelectMenu.js.map +1 -0
- package/dist/src/classes/Client.d.ts +180 -0
- package/dist/src/classes/Client.d.ts.map +1 -0
- package/dist/src/classes/Client.js +263 -0
- package/dist/src/classes/Client.js.map +1 -0
- package/dist/src/classes/Command.d.ts +33 -0
- package/dist/src/classes/Command.d.ts.map +1 -0
- package/dist/src/classes/Command.js +31 -0
- package/dist/src/classes/Command.js.map +1 -0
- package/dist/src/classes/CommandWithSubcommandGroups.d.ts +22 -0
- package/dist/src/classes/CommandWithSubcommandGroups.d.ts.map +1 -0
- package/dist/src/classes/CommandWithSubcommandGroups.js +31 -0
- package/dist/src/classes/CommandWithSubcommandGroups.js.map +1 -0
- package/dist/src/classes/CommandWithSubcommands.d.ts +19 -0
- package/dist/src/classes/CommandWithSubcommands.d.ts.map +1 -0
- package/dist/src/classes/CommandWithSubcommands.js +21 -0
- package/dist/src/classes/CommandWithSubcommands.js.map +1 -0
- package/dist/src/classes/Embed.d.ts +61 -0
- package/dist/src/classes/Embed.d.ts.map +1 -0
- package/dist/src/classes/Embed.js +75 -0
- package/dist/src/classes/Embed.js.map +1 -0
- package/dist/src/classes/MentionableSelectMenu.d.ts +13 -0
- package/dist/src/classes/MentionableSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/MentionableSelectMenu.js +13 -0
- package/dist/src/classes/MentionableSelectMenu.js.map +1 -0
- package/dist/src/classes/Modal.d.ts +21 -0
- package/dist/src/classes/Modal.d.ts.map +1 -0
- package/dist/src/classes/Modal.js +14 -0
- package/dist/src/classes/Modal.js.map +1 -0
- package/dist/src/classes/RoleSelectMenu.d.ts +13 -0
- package/dist/src/classes/RoleSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/RoleSelectMenu.js +13 -0
- package/dist/src/classes/RoleSelectMenu.js.map +1 -0
- package/dist/src/classes/Row.d.ts +25 -0
- package/dist/src/classes/Row.d.ts.map +1 -0
- package/dist/src/classes/Row.js +40 -0
- package/dist/src/classes/Row.js.map +1 -0
- package/dist/src/classes/StringSelectMenu.d.ts +13 -0
- package/dist/src/classes/StringSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/StringSelectMenu.js +12 -0
- package/dist/src/classes/StringSelectMenu.js.map +1 -0
- package/dist/src/classes/TextInput.d.ts +40 -0
- package/dist/src/classes/TextInput.d.ts.map +1 -0
- package/dist/src/classes/TextInput.js +44 -0
- package/dist/src/classes/TextInput.js.map +1 -0
- package/dist/src/classes/UserSelectMenu.d.ts +13 -0
- package/dist/src/classes/UserSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/UserSelectMenu.js +13 -0
- package/dist/src/classes/UserSelectMenu.js.map +1 -0
- package/dist/src/factories/channelFactory.d.ts +13 -0
- package/dist/src/factories/channelFactory.d.ts.map +1 -0
- package/dist/src/factories/channelFactory.js +39 -0
- package/dist/src/factories/channelFactory.js.map +1 -0
- package/dist/src/index.d.ts +55 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +61 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/internals/AutocompleteInteraction.d.ts +33 -0
- package/dist/src/internals/AutocompleteInteraction.d.ts.map +1 -0
- package/dist/src/internals/AutocompleteInteraction.js +61 -0
- package/dist/src/internals/AutocompleteInteraction.js.map +1 -0
- package/dist/src/internals/ButtonInteraction.d.ts +9 -0
- package/dist/src/internals/ButtonInteraction.d.ts.map +1 -0
- package/dist/src/internals/ButtonInteraction.js +18 -0
- package/dist/src/internals/ButtonInteraction.js.map +1 -0
- package/dist/src/internals/ChannelSelectMenuInteraction.d.ts +8 -0
- package/dist/src/internals/ChannelSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/internals/ChannelSelectMenuInteraction.js +11 -0
- package/dist/src/internals/ChannelSelectMenuInteraction.js.map +1 -0
- package/dist/src/internals/CommandHandler.d.ts +12 -0
- package/dist/src/internals/CommandHandler.d.ts.map +1 -0
- package/dist/src/internals/CommandHandler.js +89 -0
- package/dist/src/internals/CommandHandler.js.map +1 -0
- package/dist/src/internals/CommandInteraction.d.ts +16 -0
- package/dist/src/internals/CommandInteraction.d.ts.map +1 -0
- package/dist/src/internals/CommandInteraction.js +23 -0
- package/dist/src/internals/CommandInteraction.js.map +1 -0
- package/dist/src/internals/ComponentHandler.d.ts +17 -0
- package/dist/src/internals/ComponentHandler.d.ts.map +1 -0
- package/dist/src/internals/ComponentHandler.js +75 -0
- package/dist/src/internals/ComponentHandler.js.map +1 -0
- 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/MentionableSelectMenuInteraction.d.ts +9 -0
- package/dist/src/internals/MentionableSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/internals/MentionableSelectMenuInteraction.js +15 -0
- package/dist/src/internals/MentionableSelectMenuInteraction.js.map +1 -0
- package/dist/src/internals/ModalHandler.d.ts +17 -0
- package/dist/src/internals/ModalHandler.d.ts.map +1 -0
- package/dist/src/internals/ModalHandler.js +25 -0
- package/dist/src/internals/ModalHandler.js.map +1 -0
- package/dist/src/internals/ModalInteraction.d.ts +22 -0
- package/dist/src/internals/ModalInteraction.d.ts.map +1 -0
- package/dist/src/internals/ModalInteraction.js +42 -0
- package/dist/src/internals/ModalInteraction.js.map +1 -0
- package/dist/src/internals/OptionsHandler.d.ts +82 -0
- package/dist/src/internals/OptionsHandler.d.ts.map +1 -0
- package/dist/src/internals/OptionsHandler.js +127 -0
- package/dist/src/internals/OptionsHandler.js.map +1 -0
- package/dist/src/internals/RoleSelectMenuInteraction.d.ts +9 -0
- package/dist/src/internals/RoleSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/internals/RoleSelectMenuInteraction.js +14 -0
- package/dist/src/internals/RoleSelectMenuInteraction.js.map +1 -0
- package/dist/src/internals/StringSelectMenuInteraction.d.ts +9 -0
- package/dist/src/internals/StringSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/internals/StringSelectMenuInteraction.js +14 -0
- package/dist/src/internals/StringSelectMenuInteraction.js.map +1 -0
- package/dist/src/internals/UserSelectMenuInteraction.d.ts +9 -0
- package/dist/src/internals/UserSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/internals/UserSelectMenuInteraction.js +14 -0
- package/dist/src/internals/UserSelectMenuInteraction.js.map +1 -0
- package/dist/src/plugins/linked-roles/LinkedRoles.d.ts +49 -0
- package/dist/src/plugins/linked-roles/LinkedRoles.d.ts.map +1 -0
- package/dist/src/plugins/linked-roles/LinkedRoles.js +164 -0
- package/dist/src/plugins/linked-roles/LinkedRoles.js.map +1 -0
- package/dist/src/plugins/linked-roles/index.d.ts +3 -0
- package/dist/src/plugins/linked-roles/index.d.ts.map +1 -0
- package/dist/src/plugins/linked-roles/index.js +3 -0
- package/dist/src/plugins/linked-roles/index.js.map +1 -0
- package/dist/src/plugins/linked-roles/types.d.ts +88 -0
- package/dist/src/plugins/linked-roles/types.d.ts.map +1 -0
- package/dist/src/plugins/linked-roles/types.js +39 -0
- package/dist/src/plugins/linked-roles/types.js.map +1 -0
- package/dist/src/structures/DmChannel.d.ts +19 -0
- package/dist/src/structures/DmChannel.d.ts.map +1 -0
- package/dist/src/structures/DmChannel.js +25 -0
- package/dist/src/structures/DmChannel.js.map +1 -0
- package/dist/src/structures/GroupDmChannel.d.ts +65 -0
- package/dist/src/structures/GroupDmChannel.d.ts.map +1 -0
- package/dist/src/structures/GroupDmChannel.js +116 -0
- package/dist/src/structures/GroupDmChannel.js.map +1 -0
- package/dist/src/structures/Guild.d.ts +77 -0
- package/dist/src/structures/Guild.d.ts.map +1 -0
- package/dist/src/structures/Guild.js +156 -0
- package/dist/src/structures/Guild.js.map +1 -0
- package/dist/src/structures/GuildAnnouncementChannel.d.ts +11 -0
- package/dist/src/structures/GuildAnnouncementChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildAnnouncementChannel.js +15 -0
- package/dist/src/structures/GuildAnnouncementChannel.js.map +1 -0
- package/dist/src/structures/GuildCategoryChannel.d.ts +13 -0
- package/dist/src/structures/GuildCategoryChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildCategoryChannel.js +13 -0
- package/dist/src/structures/GuildCategoryChannel.js.map +1 -0
- package/dist/src/structures/GuildForumChannel.d.ts +14 -0
- package/dist/src/structures/GuildForumChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildForumChannel.js +15 -0
- package/dist/src/structures/GuildForumChannel.js.map +1 -0
- package/dist/src/structures/GuildMediaChannel.d.ts +9 -0
- package/dist/src/structures/GuildMediaChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildMediaChannel.js +7 -0
- package/dist/src/structures/GuildMediaChannel.js.map +1 -0
- package/dist/src/structures/GuildMember.d.ts +111 -0
- package/dist/src/structures/GuildMember.d.ts.map +1 -0
- package/dist/src/structures/GuildMember.js +224 -0
- package/dist/src/structures/GuildMember.js.map +1 -0
- package/dist/src/structures/GuildStageOrVoiceChannel.d.ts +31 -0
- package/dist/src/structures/GuildStageOrVoiceChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildStageOrVoiceChannel.js +43 -0
- package/dist/src/structures/GuildStageOrVoiceChannel.js.map +1 -0
- package/dist/src/structures/GuildTextChannel.d.ts +15 -0
- package/dist/src/structures/GuildTextChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildTextChannel.js +20 -0
- package/dist/src/structures/GuildTextChannel.js.map +1 -0
- package/dist/src/structures/GuildThreadChannel.d.ts +90 -0
- package/dist/src/structures/GuildThreadChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildThreadChannel.js +165 -0
- package/dist/src/structures/GuildThreadChannel.js.map +1 -0
- package/dist/src/structures/Message.d.ts +153 -0
- package/dist/src/structures/Message.d.ts.map +1 -0
- package/dist/src/structures/Message.js +296 -0
- package/dist/src/structures/Message.js.map +1 -0
- package/dist/src/structures/Role.d.ts +108 -0
- package/dist/src/structures/Role.d.ts.map +1 -0
- package/dist/src/structures/Role.js +220 -0
- package/dist/src/structures/Role.js.map +1 -0
- package/dist/src/structures/User.d.ts +82 -0
- package/dist/src/structures/User.d.ts.map +1 -0
- package/dist/src/structures/User.js +166 -0
- package/dist/src/structures/User.js.map +1 -0
- package/dist/src/types.d.ts +37 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils.d.ts +22 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/src/utils.js +79 -0
- package/dist/src/utils.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { APIModalInteractionResponseCallbackData } from "discord-api-types/v10";
|
|
2
|
+
import type { ModalInteraction } from "../internals/ModalInteraction.js";
|
|
3
|
+
import type { Row } from "./Row.js";
|
|
4
|
+
import type { TextInput } from "./TextInput.js";
|
|
5
|
+
export declare abstract class Modal {
|
|
6
|
+
/**
|
|
7
|
+
* The title of the modal
|
|
8
|
+
*/
|
|
9
|
+
abstract title: string;
|
|
10
|
+
/**
|
|
11
|
+
* The components of the modal
|
|
12
|
+
*/
|
|
13
|
+
components: Row<TextInput>[];
|
|
14
|
+
/**
|
|
15
|
+
* The custom ID of the modal
|
|
16
|
+
*/
|
|
17
|
+
abstract customId: string;
|
|
18
|
+
abstract run(interaction: ModalInteraction): Promise<void>;
|
|
19
|
+
serialize: () => APIModalInteractionResponseCallbackData;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=Modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/classes/Modal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,uCAAuC,EAEvC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACxE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,8BAAsB,KAAK;IAC1B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,UAAU,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,CAAK;IAEjC;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IAEzB,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAE1D,SAAS,QAAO,uCAAuC,CAStD;CACD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class Modal {
|
|
2
|
+
/**
|
|
3
|
+
* The components of the modal
|
|
4
|
+
*/
|
|
5
|
+
components = [];
|
|
6
|
+
serialize = () => {
|
|
7
|
+
return {
|
|
8
|
+
title: this.title,
|
|
9
|
+
custom_id: this.customId,
|
|
10
|
+
components: this.components.map((row) => row.serialize())
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=Modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../src/classes/Modal.ts"],"names":[],"mappings":"AASA,MAAM,OAAgB,KAAK;IAM1B;;OAEG;IACH,UAAU,GAAqB,EAAE,CAAA;IASjC,SAAS,GAAG,GAA4C,EAAE;QACzD,OAAO;YACN,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,SAAS,EAAE,IAAI,CAAC,QAAQ;YACxB,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAC9B,CAAC,GAAG,EAAE,EAAE,CACP,GAAG,CAAC,SAAS,EAA6D,CAC3E;SACD,CAAA;IACF,CAAC,CAAA;CACD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type APIRoleSelectComponent, ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import { AnySelectMenu } from "../abstracts/AnySelectMenu.js";
|
|
3
|
+
import type { RoleSelectMenuInteraction } from "../internals/RoleSelectMenuInteraction.js";
|
|
4
|
+
export declare abstract class RoleSelectMenu extends AnySelectMenu {
|
|
5
|
+
type: ComponentType.RoleSelect;
|
|
6
|
+
defaultValues?: APIRoleSelectComponent["default_values"];
|
|
7
|
+
abstract run(interaction: RoleSelectMenuInteraction): Promise<void>;
|
|
8
|
+
serializeOptions(): {
|
|
9
|
+
type: ComponentType.RoleSelect;
|
|
10
|
+
default_values: import("discord-api-types/v10").APISelectMenuDefaultValue<import("discord-api-types/v10").SelectMenuDefaultValueType.Role>[] | undefined;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=RoleSelectMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleSelectMenu.d.ts","sourceRoot":"","sources":["../../../src/classes/RoleSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,sBAAsB,EAC3B,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAA;AAE1F,8BAAsB,cAAe,SAAQ,aAAa;IACzD,IAAI,EAAE,aAAa,CAAC,UAAU,CAA2B;IACzD,aAAa,CAAC,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,CAAA;IACxD,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAEnE,gBAAgB;;;;CAMhB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import { AnySelectMenu } from "../abstracts/AnySelectMenu.js";
|
|
3
|
+
export class RoleSelectMenu extends AnySelectMenu {
|
|
4
|
+
type = ComponentType.RoleSelect;
|
|
5
|
+
defaultValues;
|
|
6
|
+
serializeOptions() {
|
|
7
|
+
return {
|
|
8
|
+
type: this.type,
|
|
9
|
+
default_values: this.defaultValues
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=RoleSelectMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleSelectMenu.js","sourceRoot":"","sources":["../../../src/classes/RoleSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAG7D,MAAM,OAAgB,cAAe,SAAQ,aAAa;IACzD,IAAI,GAA6B,aAAa,CAAC,UAAU,CAAA;IACzD,aAAa,CAA2C;IAGxD,gBAAgB;QACf,OAAO;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,cAAc,EAAE,IAAI,CAAC,aAAa;SAClC,CAAA;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { APIActionRowComponent, APIActionRowComponentTypes } from "discord-api-types/v10";
|
|
2
|
+
import type { BaseComponent } from "../abstracts/BaseComponent.js";
|
|
3
|
+
export declare class Row<T extends BaseComponent = BaseComponent> {
|
|
4
|
+
/**
|
|
5
|
+
* The components in the action row
|
|
6
|
+
*/
|
|
7
|
+
components: T[];
|
|
8
|
+
constructor(components?: T[]);
|
|
9
|
+
/**
|
|
10
|
+
* Add a component to the action row
|
|
11
|
+
* @param component The component to add
|
|
12
|
+
*/
|
|
13
|
+
addComponent(component: T): void;
|
|
14
|
+
/**
|
|
15
|
+
* Remove a component from the action row
|
|
16
|
+
* @param component The component to remove
|
|
17
|
+
*/
|
|
18
|
+
removeComponent(component: T): void;
|
|
19
|
+
/**
|
|
20
|
+
* Remove all components from the action row
|
|
21
|
+
*/
|
|
22
|
+
removeAllComponents(): void;
|
|
23
|
+
serialize: () => APIActionRowComponent<APIActionRowComponentTypes>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=Row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../src/classes/Row.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,qBAAqB,EACrB,0BAA0B,EAC1B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAElE,qBAAa,GAAG,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa;IACvD;;OAEG;IACH,UAAU,EAAE,CAAC,EAAE,CAAK;gBAER,UAAU,CAAC,EAAE,CAAC,EAAE;IAI5B;;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,CAAC;IAIzB;;;OAGG;IACH,eAAe,CAAC,SAAS,EAAE,CAAC;IAM5B;;OAEG;IACH,mBAAmB;IAInB,SAAS,QAAO,qBAAqB,CAAC,0BAA0B,CAAC,CAOhE;CACD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export class Row {
|
|
2
|
+
/**
|
|
3
|
+
* The components in the action row
|
|
4
|
+
*/
|
|
5
|
+
components = [];
|
|
6
|
+
constructor(components) {
|
|
7
|
+
if (components)
|
|
8
|
+
this.components = components;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Add a component to the action row
|
|
12
|
+
* @param component The component to add
|
|
13
|
+
*/
|
|
14
|
+
addComponent(component) {
|
|
15
|
+
this.components.push(component);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Remove a component from the action row
|
|
19
|
+
* @param component The component to remove
|
|
20
|
+
*/
|
|
21
|
+
removeComponent(component) {
|
|
22
|
+
const index = this.components.indexOf(component);
|
|
23
|
+
if (index === -1)
|
|
24
|
+
return;
|
|
25
|
+
this.components.splice(index, 1);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Remove all components from the action row
|
|
29
|
+
*/
|
|
30
|
+
removeAllComponents() {
|
|
31
|
+
this.components = [];
|
|
32
|
+
}
|
|
33
|
+
serialize = () => {
|
|
34
|
+
return {
|
|
35
|
+
type: 1,
|
|
36
|
+
components: this.components.map((component) => component.serialize())
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=Row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Row.js","sourceRoot":"","sources":["../../../src/classes/Row.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,GAAG;IACf;;OAEG;IACH,UAAU,GAAQ,EAAE,CAAA;IAEpB,YAAY,UAAgB;QAC3B,IAAI,UAAU;YAAE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC7C,CAAC;IAED;;;OAGG;IACH,YAAY,CAAC,SAAY;QACxB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAChC,CAAC;IAED;;;OAGG;IACH,eAAe,CAAC,SAAY;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;QAChD,IAAI,KAAK,KAAK,CAAC,CAAC;YAAE,OAAM;QACxB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IACjC,CAAC;IAED;;OAEG;IACH,mBAAmB;QAClB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAA;IACrB,CAAC;IAED,SAAS,GAAG,GAAsD,EAAE;QACnE,OAAO;YACN,IAAI,EAAE,CAAC;YACP,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAC7C,SAAS,CAAC,SAAS,EAAE,CACW;SACjC,CAAA;IACF,CAAC,CAAA;CACD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type APIStringSelectComponent, ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import { AnySelectMenu } from "../abstracts/AnySelectMenu.js";
|
|
3
|
+
import type { StringSelectMenuInteraction } from "../internals/StringSelectMenuInteraction.js";
|
|
4
|
+
export declare abstract class StringSelectMenu extends AnySelectMenu {
|
|
5
|
+
type: ComponentType.StringSelect;
|
|
6
|
+
abstract options: APIStringSelectComponent["options"];
|
|
7
|
+
abstract run(interaction: StringSelectMenuInteraction): Promise<void>;
|
|
8
|
+
serializeOptions(): {
|
|
9
|
+
type: ComponentType.StringSelect;
|
|
10
|
+
options: import("discord-api-types/v10").APISelectMenuOption[];
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=StringSelectMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringSelectMenu.d.ts","sourceRoot":"","sources":["../../../src/classes/StringSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,wBAAwB,EAC7B,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAA;AAE9F,8BAAsB,gBAAiB,SAAQ,aAAa;IAC3D,IAAI,EAAE,aAAa,CAAC,YAAY,CAA6B;IAC7D,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAA;IACrD,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC;IAErE,gBAAgB;;;;CAMhB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import { AnySelectMenu } from "../abstracts/AnySelectMenu.js";
|
|
3
|
+
export class StringSelectMenu extends AnySelectMenu {
|
|
4
|
+
type = ComponentType.StringSelect;
|
|
5
|
+
serializeOptions() {
|
|
6
|
+
return {
|
|
7
|
+
type: this.type,
|
|
8
|
+
options: this.options
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=StringSelectMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringSelectMenu.js","sourceRoot":"","sources":["../../../src/classes/StringSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAG7D,MAAM,OAAgB,gBAAiB,SAAQ,aAAa;IAC3D,IAAI,GAA+B,aAAa,CAAC,YAAY,CAAA;IAI7D,gBAAgB;QACf,OAAO;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAA;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type APITextInputComponent, ComponentType, TextInputStyle } from "discord-api-types/v10";
|
|
2
|
+
import { BaseComponent } from "../abstracts/BaseComponent.js";
|
|
3
|
+
export declare abstract class TextInput extends BaseComponent {
|
|
4
|
+
type: ComponentType;
|
|
5
|
+
/**
|
|
6
|
+
* The custom ID of the text input
|
|
7
|
+
*/
|
|
8
|
+
abstract customId: string;
|
|
9
|
+
/**
|
|
10
|
+
* The label of the text input
|
|
11
|
+
*/
|
|
12
|
+
abstract label: string;
|
|
13
|
+
/**
|
|
14
|
+
* The style of the text input
|
|
15
|
+
* @default TextInputStyle.Short
|
|
16
|
+
*/
|
|
17
|
+
style: TextInputStyle;
|
|
18
|
+
/**
|
|
19
|
+
* The minimum length of the text input
|
|
20
|
+
*/
|
|
21
|
+
minLength?: number;
|
|
22
|
+
/**
|
|
23
|
+
* The maximum length of the text input
|
|
24
|
+
*/
|
|
25
|
+
maxLength?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the text input is required
|
|
28
|
+
*/
|
|
29
|
+
required?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The value of the text input
|
|
32
|
+
*/
|
|
33
|
+
value?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The placeholder of the text input
|
|
36
|
+
*/
|
|
37
|
+
placeholder?: string;
|
|
38
|
+
serialize: () => APITextInputComponent;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=TextInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../src/classes/TextInput.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,qBAAqB,EAC1B,aAAa,EACb,cAAc,EACd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAE7D,8BAAsB,SAAU,SAAQ,aAAa;IACpD,IAAI,gBAA0B;IAE9B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IAEzB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IAEtB;;;OAGG;IACH,KAAK,EAAE,cAAc,CAAuB;IAE5C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,SAAS,QAAO,qBAAqB,CAYpC;CACD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ComponentType, TextInputStyle } from "discord-api-types/v10";
|
|
2
|
+
import { BaseComponent } from "../abstracts/BaseComponent.js";
|
|
3
|
+
export class TextInput extends BaseComponent {
|
|
4
|
+
type = ComponentType.TextInput;
|
|
5
|
+
/**
|
|
6
|
+
* The style of the text input
|
|
7
|
+
* @default TextInputStyle.Short
|
|
8
|
+
*/
|
|
9
|
+
style = TextInputStyle.Short;
|
|
10
|
+
/**
|
|
11
|
+
* The minimum length of the text input
|
|
12
|
+
*/
|
|
13
|
+
minLength;
|
|
14
|
+
/**
|
|
15
|
+
* The maximum length of the text input
|
|
16
|
+
*/
|
|
17
|
+
maxLength;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the text input is required
|
|
20
|
+
*/
|
|
21
|
+
required;
|
|
22
|
+
/**
|
|
23
|
+
* The value of the text input
|
|
24
|
+
*/
|
|
25
|
+
value;
|
|
26
|
+
/**
|
|
27
|
+
* The placeholder of the text input
|
|
28
|
+
*/
|
|
29
|
+
placeholder;
|
|
30
|
+
serialize = () => {
|
|
31
|
+
return {
|
|
32
|
+
type: ComponentType.TextInput,
|
|
33
|
+
custom_id: this.customId,
|
|
34
|
+
style: this.style,
|
|
35
|
+
label: this.label,
|
|
36
|
+
min_length: this.minLength,
|
|
37
|
+
max_length: this.maxLength,
|
|
38
|
+
required: this.required,
|
|
39
|
+
value: this.value,
|
|
40
|
+
placeholder: this.placeholder
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=TextInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../src/classes/TextInput.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,aAAa,EACb,cAAc,EACd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAE7D,MAAM,OAAgB,SAAU,SAAQ,aAAa;IACpD,IAAI,GAAG,aAAa,CAAC,SAAS,CAAA;IAY9B;;;OAGG;IACH,KAAK,GAAmB,cAAc,CAAC,KAAK,CAAA;IAE5C;;OAEG;IACH,SAAS,CAAS;IAElB;;OAEG;IACH,SAAS,CAAS;IAElB;;OAEG;IACH,QAAQ,CAAU;IAElB;;OAEG;IACH,KAAK,CAAS;IAEd;;OAEG;IACH,WAAW,CAAS;IAEpB,SAAS,GAAG,GAA0B,EAAE;QACvC,OAAO;YACN,IAAI,EAAE,aAAa,CAAC,SAAS;YAC7B,SAAS,EAAE,IAAI,CAAC,QAAQ;YACxB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,UAAU,EAAE,IAAI,CAAC,SAAS;YAC1B,UAAU,EAAE,IAAI,CAAC,SAAS;YAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;SAC7B,CAAA;IACF,CAAC,CAAA;CACD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type APIUserSelectComponent, ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import { AnySelectMenu } from "../abstracts/AnySelectMenu.js";
|
|
3
|
+
import type { UserSelectMenuInteraction } from "../internals/UserSelectMenuInteraction.js";
|
|
4
|
+
export declare abstract class UserSelectMenu extends AnySelectMenu {
|
|
5
|
+
type: ComponentType.UserSelect;
|
|
6
|
+
defaultValues?: APIUserSelectComponent["default_values"];
|
|
7
|
+
abstract run(interaction: UserSelectMenuInteraction): Promise<void>;
|
|
8
|
+
serializeOptions(): {
|
|
9
|
+
type: ComponentType.UserSelect;
|
|
10
|
+
default_values: import("discord-api-types/v10").APISelectMenuDefaultValue<import("discord-api-types/v10").SelectMenuDefaultValueType.User>[] | undefined;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=UserSelectMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserSelectMenu.d.ts","sourceRoot":"","sources":["../../../src/classes/UserSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,sBAAsB,EAC3B,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAA;AAE1F,8BAAsB,cAAe,SAAQ,aAAa;IACzD,IAAI,EAAE,aAAa,CAAC,UAAU,CAA2B;IACzD,aAAa,CAAC,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,CAAA;IACxD,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAEnE,gBAAgB;;;;CAMhB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import { AnySelectMenu } from "../abstracts/AnySelectMenu.js";
|
|
3
|
+
export class UserSelectMenu extends AnySelectMenu {
|
|
4
|
+
type = ComponentType.UserSelect;
|
|
5
|
+
defaultValues;
|
|
6
|
+
serializeOptions() {
|
|
7
|
+
return {
|
|
8
|
+
type: this.type,
|
|
9
|
+
default_values: this.defaultValues
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=UserSelectMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserSelectMenu.js","sourceRoot":"","sources":["../../../src/classes/UserSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAG7D,MAAM,OAAgB,cAAe,SAAQ,aAAa;IACzD,IAAI,GAA6B,aAAa,CAAC,UAAU,CAAA;IACzD,aAAa,CAA2C;IAGxD,gBAAgB;QACf,OAAO;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,cAAc,EAAE,IAAI,CAAC,aAAa;SAClC,CAAA;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type APIChannel } from "discord-api-types/v10";
|
|
2
|
+
import type { Client } from "../classes/Client.js";
|
|
3
|
+
import { DmChannel } from "../structures/DmChannel.js";
|
|
4
|
+
import { GroupDmChannel } from "../structures/GroupDmChannel.js";
|
|
5
|
+
import { GuildAnnouncementChannel } from "../structures/GuildAnnouncementChannel.js";
|
|
6
|
+
import { GuildCategoryChannel } from "../structures/GuildCategoryChannel.js";
|
|
7
|
+
import { GuildForumChannel } from "../structures/GuildForumChannel.js";
|
|
8
|
+
import { GuildMediaChannel } from "../structures/GuildMediaChannel.js";
|
|
9
|
+
import { GuildStageChannel, GuildVoiceChannel } from "../structures/GuildStageOrVoiceChannel.js";
|
|
10
|
+
import { GuildTextChannel } from "../structures/GuildTextChannel.js";
|
|
11
|
+
import { GuildThreadChannel } from "../structures/GuildThreadChannel.js";
|
|
12
|
+
export declare const channelFactory: (client: Client, channelData: APIChannel) => DmChannel<false> | GroupDmChannel<false> | GuildTextChannel<false> | GuildVoiceChannel<false> | GuildCategoryChannel<false> | GuildAnnouncementChannel<false> | GuildThreadChannel<import("discord-api-types/v10").ThreadChannelType, false> | GuildStageChannel<false> | GuildForumChannel<false> | GuildMediaChannel | null;
|
|
13
|
+
//# sourceMappingURL=channelFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channelFactory.d.ts","sourceRoot":"","sources":["../../../src/factories/channelFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAA;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AACtE,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,2CAA2C,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AAExE,eAAO,MAAM,cAAc,WAAY,MAAM,eAAe,UAAU,kUA2BrE,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ChannelType } from "discord-api-types/v10";
|
|
2
|
+
import { DmChannel } from "../structures/DmChannel.js";
|
|
3
|
+
import { GroupDmChannel } from "../structures/GroupDmChannel.js";
|
|
4
|
+
import { GuildAnnouncementChannel } from "../structures/GuildAnnouncementChannel.js";
|
|
5
|
+
import { GuildCategoryChannel } from "../structures/GuildCategoryChannel.js";
|
|
6
|
+
import { GuildForumChannel } from "../structures/GuildForumChannel.js";
|
|
7
|
+
import { GuildMediaChannel } from "../structures/GuildMediaChannel.js";
|
|
8
|
+
import { GuildStageChannel, GuildVoiceChannel } from "../structures/GuildStageOrVoiceChannel.js";
|
|
9
|
+
import { GuildTextChannel } from "../structures/GuildTextChannel.js";
|
|
10
|
+
import { GuildThreadChannel } from "../structures/GuildThreadChannel.js";
|
|
11
|
+
export const channelFactory = (client, channelData) => {
|
|
12
|
+
switch (channelData.type) {
|
|
13
|
+
case ChannelType.DM:
|
|
14
|
+
return new DmChannel(client, channelData);
|
|
15
|
+
case ChannelType.GroupDM:
|
|
16
|
+
return new GroupDmChannel(client, channelData);
|
|
17
|
+
case ChannelType.GuildText:
|
|
18
|
+
return new GuildTextChannel(client, channelData);
|
|
19
|
+
case ChannelType.GuildVoice:
|
|
20
|
+
return new GuildVoiceChannel(client, channelData);
|
|
21
|
+
case ChannelType.GuildCategory:
|
|
22
|
+
return new GuildCategoryChannel(client, channelData);
|
|
23
|
+
case ChannelType.GuildAnnouncement:
|
|
24
|
+
return new GuildAnnouncementChannel(client, channelData);
|
|
25
|
+
case ChannelType.AnnouncementThread:
|
|
26
|
+
case ChannelType.PublicThread:
|
|
27
|
+
case ChannelType.PrivateThread:
|
|
28
|
+
return new GuildThreadChannel(client, channelData);
|
|
29
|
+
case ChannelType.GuildStageVoice:
|
|
30
|
+
return new GuildStageChannel(client, channelData);
|
|
31
|
+
case ChannelType.GuildForum:
|
|
32
|
+
return new GuildForumChannel(client, channelData);
|
|
33
|
+
case ChannelType.GuildMedia:
|
|
34
|
+
return new GuildMediaChannel(client, channelData);
|
|
35
|
+
default:
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=channelFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channelFactory.js","sourceRoot":"","sources":["../../../src/factories/channelFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAA;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AACtE,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,2CAA2C,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AAExE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAc,EAAE,WAAuB,EAAE,EAAE;IACzE,QAAQ,WAAW,CAAC,IAAI,EAAE,CAAC;QAC1B,KAAK,WAAW,CAAC,EAAE;YAClB,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;QAC1C,KAAK,WAAW,CAAC,OAAO;YACvB,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;QAC/C,KAAK,WAAW,CAAC,SAAS;YACzB,OAAO,IAAI,gBAAgB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;QACjD,KAAK,WAAW,CAAC,UAAU;YAC1B,OAAO,IAAI,iBAAiB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;QAClD,KAAK,WAAW,CAAC,aAAa;YAC7B,OAAO,IAAI,oBAAoB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;QACrD,KAAK,WAAW,CAAC,iBAAiB;YACjC,OAAO,IAAI,wBAAwB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;QACzD,KAAK,WAAW,CAAC,kBAAkB,CAAC;QACpC,KAAK,WAAW,CAAC,YAAY,CAAC;QAC9B,KAAK,WAAW,CAAC,aAAa;YAC7B,OAAO,IAAI,kBAAkB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;QACnD,KAAK,WAAW,CAAC,eAAe;YAC/B,OAAO,IAAI,iBAAiB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;QAClD,KAAK,WAAW,CAAC,UAAU;YAC1B,OAAO,IAAI,iBAAiB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;QAClD,KAAK,WAAW,CAAC,UAAU;YAC1B,OAAO,IAAI,iBAAiB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;QAClD;YACC,OAAO,IAAI,CAAA;IACb,CAAC;AACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export * from "./abstracts/AnySelectMenu.js";
|
|
2
|
+
export * from "./abstracts/AnySelectMenuInteraction.js";
|
|
3
|
+
export * from "./abstracts/Base.js";
|
|
4
|
+
export * from "./abstracts/BaseChannel.js";
|
|
5
|
+
export * from "./abstracts/BaseCommand.js";
|
|
6
|
+
export * from "./abstracts/BaseComponent.js";
|
|
7
|
+
export * from "./abstracts/BaseComponentInteraction.js";
|
|
8
|
+
export * from "./abstracts/BaseGuildChannel.js";
|
|
9
|
+
export * from "./abstracts/BaseGuildTextChannel.js";
|
|
10
|
+
export * from "./abstracts/BaseInteraction.js";
|
|
11
|
+
export * from "./abstracts/GuildThreadOnlyChannel.js";
|
|
12
|
+
export * from "./classes/Button.js";
|
|
13
|
+
export * from "./classes/ChannelSelectMenu.js";
|
|
14
|
+
export * from "./classes/Client.js";
|
|
15
|
+
export * from "./classes/Command.js";
|
|
16
|
+
export * from "./classes/CommandWithSubcommandGroups.js";
|
|
17
|
+
export * from "./classes/CommandWithSubcommands.js";
|
|
18
|
+
export * from "./classes/Embed.js";
|
|
19
|
+
export * from "./classes/MentionableSelectMenu.js";
|
|
20
|
+
export * from "./classes/Modal.js";
|
|
21
|
+
export * from "./classes/RoleSelectMenu.js";
|
|
22
|
+
export * from "./classes/Row.js";
|
|
23
|
+
export * from "./classes/StringSelectMenu.js";
|
|
24
|
+
export * from "./classes/TextInput.js";
|
|
25
|
+
export * from "./classes/UserSelectMenu.js";
|
|
26
|
+
export * from "./factories/channelFactory.js";
|
|
27
|
+
export * from "./internals/AutocompleteInteraction.js";
|
|
28
|
+
export * from "./internals/ButtonInteraction.js";
|
|
29
|
+
export * from "./internals/ChannelSelectMenuInteraction.js";
|
|
30
|
+
export * from "./internals/CommandHandler.js";
|
|
31
|
+
export * from "./internals/CommandInteraction.js";
|
|
32
|
+
export * from "./internals/ComponentHandler.js";
|
|
33
|
+
export * from "./internals/MentionableSelectMenuInteraction.js";
|
|
34
|
+
export * from "./internals/ModalHandler.js";
|
|
35
|
+
export * from "./internals/ModalInteraction.js";
|
|
36
|
+
export * from "./internals/OptionsHandler.js";
|
|
37
|
+
export * from "./internals/RoleSelectMenuInteraction.js";
|
|
38
|
+
export * from "./internals/StringSelectMenuInteraction.js";
|
|
39
|
+
export * from "./internals/UserSelectMenuInteraction.js";
|
|
40
|
+
export * from "./structures/DmChannel.js";
|
|
41
|
+
export * from "./structures/GroupDmChannel.js";
|
|
42
|
+
export * from "./structures/Guild.js";
|
|
43
|
+
export * from "./structures/GuildAnnouncementChannel.js";
|
|
44
|
+
export * from "./structures/GuildCategoryChannel.js";
|
|
45
|
+
export * from "./structures/GuildForumChannel.js";
|
|
46
|
+
export * from "./structures/GuildMediaChannel.js";
|
|
47
|
+
export * from "./structures/GuildMember.js";
|
|
48
|
+
export * from "./structures/GuildStageOrVoiceChannel.js";
|
|
49
|
+
export * from "./structures/GuildTextChannel.js";
|
|
50
|
+
export * from "./structures/GuildThreadChannel.js";
|
|
51
|
+
export * from "./structures/Message.js";
|
|
52
|
+
export * from "./structures/Role.js";
|
|
53
|
+
export * from "./structures/User.js";
|
|
54
|
+
export * from "discord-api-types/v10";
|
|
55
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yCAAyC,CAAA;AACvD,cAAc,qBAAqB,CAAA;AACnC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yCAAyC,CAAA;AACvD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,qCAAqC,CAAA;AACnD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,uCAAuC,CAAA;AAGrD,cAAc,qBAAqB,CAAA;AACnC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0CAA0C,CAAA;AACxD,cAAc,qCAAqC,CAAA;AACnD,cAAc,oBAAoB,CAAA;AAClC,cAAc,oCAAoC,CAAA;AAClD,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,kBAAkB,CAAA;AAChC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA;AAG3C,cAAc,+BAA+B,CAAA;AAG7C,cAAc,wCAAwC,CAAA;AACtD,cAAc,kCAAkC,CAAA;AAChD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iDAAiD,CAAA;AAC/D,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0CAA0C,CAAA;AACxD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,0CAA0C,CAAA;AAGxD,cAAc,2BAA2B,CAAA;AACzC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,uBAAuB,CAAA;AACrC,cAAc,0CAA0C,CAAA;AACxD,cAAc,sCAAsC,CAAA;AACpD,cAAc,mCAAmC,CAAA;AACjD,cAAc,mCAAmC,CAAA;AACjD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0CAA0C,CAAA;AACxD,cAAc,kCAAkC,CAAA;AAChD,cAAc,oCAAoC,CAAA;AAClD,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AAGpC,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// ----- Abstracts -----
|
|
2
|
+
export * from "./abstracts/AnySelectMenu.js";
|
|
3
|
+
export * from "./abstracts/AnySelectMenuInteraction.js";
|
|
4
|
+
export * from "./abstracts/Base.js";
|
|
5
|
+
export * from "./abstracts/BaseChannel.js";
|
|
6
|
+
export * from "./abstracts/BaseCommand.js";
|
|
7
|
+
export * from "./abstracts/BaseComponent.js";
|
|
8
|
+
export * from "./abstracts/BaseComponentInteraction.js";
|
|
9
|
+
export * from "./abstracts/BaseGuildChannel.js";
|
|
10
|
+
export * from "./abstracts/BaseGuildTextChannel.js";
|
|
11
|
+
export * from "./abstracts/BaseInteraction.js";
|
|
12
|
+
export * from "./abstracts/GuildThreadOnlyChannel.js";
|
|
13
|
+
// ----- Classes -----
|
|
14
|
+
export * from "./classes/Button.js";
|
|
15
|
+
export * from "./classes/ChannelSelectMenu.js";
|
|
16
|
+
export * from "./classes/Client.js";
|
|
17
|
+
export * from "./classes/Command.js";
|
|
18
|
+
export * from "./classes/CommandWithSubcommandGroups.js";
|
|
19
|
+
export * from "./classes/CommandWithSubcommands.js";
|
|
20
|
+
export * from "./classes/Embed.js";
|
|
21
|
+
export * from "./classes/MentionableSelectMenu.js";
|
|
22
|
+
export * from "./classes/Modal.js";
|
|
23
|
+
export * from "./classes/RoleSelectMenu.js";
|
|
24
|
+
export * from "./classes/Row.js";
|
|
25
|
+
export * from "./classes/StringSelectMenu.js";
|
|
26
|
+
export * from "./classes/TextInput.js";
|
|
27
|
+
export * from "./classes/UserSelectMenu.js";
|
|
28
|
+
// ----- Factories -----
|
|
29
|
+
export * from "./factories/channelFactory.js";
|
|
30
|
+
// ----- Internals -----
|
|
31
|
+
export * from "./internals/AutocompleteInteraction.js";
|
|
32
|
+
export * from "./internals/ButtonInteraction.js";
|
|
33
|
+
export * from "./internals/ChannelSelectMenuInteraction.js";
|
|
34
|
+
export * from "./internals/CommandHandler.js";
|
|
35
|
+
export * from "./internals/CommandInteraction.js";
|
|
36
|
+
export * from "./internals/ComponentHandler.js";
|
|
37
|
+
export * from "./internals/MentionableSelectMenuInteraction.js";
|
|
38
|
+
export * from "./internals/ModalHandler.js";
|
|
39
|
+
export * from "./internals/ModalInteraction.js";
|
|
40
|
+
export * from "./internals/OptionsHandler.js";
|
|
41
|
+
export * from "./internals/RoleSelectMenuInteraction.js";
|
|
42
|
+
export * from "./internals/StringSelectMenuInteraction.js";
|
|
43
|
+
export * from "./internals/UserSelectMenuInteraction.js";
|
|
44
|
+
// ----- Structures -----
|
|
45
|
+
export * from "./structures/DmChannel.js";
|
|
46
|
+
export * from "./structures/GroupDmChannel.js";
|
|
47
|
+
export * from "./structures/Guild.js";
|
|
48
|
+
export * from "./structures/GuildAnnouncementChannel.js";
|
|
49
|
+
export * from "./structures/GuildCategoryChannel.js";
|
|
50
|
+
export * from "./structures/GuildForumChannel.js";
|
|
51
|
+
export * from "./structures/GuildMediaChannel.js";
|
|
52
|
+
export * from "./structures/GuildMember.js";
|
|
53
|
+
export * from "./structures/GuildStageOrVoiceChannel.js";
|
|
54
|
+
export * from "./structures/GuildTextChannel.js";
|
|
55
|
+
export * from "./structures/GuildThreadChannel.js";
|
|
56
|
+
export * from "./structures/Message.js";
|
|
57
|
+
export * from "./structures/Role.js";
|
|
58
|
+
export * from "./structures/User.js";
|
|
59
|
+
// ----- Types -----
|
|
60
|
+
export * from "discord-api-types/v10";
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yCAAyC,CAAA;AACvD,cAAc,qBAAqB,CAAA;AACnC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yCAAyC,CAAA;AACvD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,qCAAqC,CAAA;AACnD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,uCAAuC,CAAA;AAErD,sBAAsB;AACtB,cAAc,qBAAqB,CAAA;AACnC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0CAA0C,CAAA;AACxD,cAAc,qCAAqC,CAAA;AACnD,cAAc,oBAAoB,CAAA;AAClC,cAAc,oCAAoC,CAAA;AAClD,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,kBAAkB,CAAA;AAChC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA;AAE3C,wBAAwB;AACxB,cAAc,+BAA+B,CAAA;AAE7C,wBAAwB;AACxB,cAAc,wCAAwC,CAAA;AACtD,cAAc,kCAAkC,CAAA;AAChD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iDAAiD,CAAA;AAC/D,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0CAA0C,CAAA;AACxD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,0CAA0C,CAAA;AAExD,yBAAyB;AACzB,cAAc,2BAA2B,CAAA;AACzC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,uBAAuB,CAAA;AACrC,cAAc,0CAA0C,CAAA;AACxD,cAAc,sCAAsC,CAAA;AACpD,cAAc,mCAAmC,CAAA;AACjD,cAAc,mCAAmC,CAAA;AACjD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0CAA0C,CAAA;AACxD,cAAc,kCAAkC,CAAA;AAChD,cAAc,oCAAoC,CAAA;AAClD,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AAEpC,oBAAoB;AACpB,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type APIApplicationCommandAutocompleteInteraction } from "discord-api-types/v10";
|
|
2
|
+
import { BaseInteraction, type InteractionDefaults } from "../abstracts/BaseInteraction.js";
|
|
3
|
+
import type { Client } from "../classes/Client.js";
|
|
4
|
+
import { OptionsHandler } from "./OptionsHandler.js";
|
|
5
|
+
export declare class AutocompleteInteraction extends BaseInteraction<APIApplicationCommandAutocompleteInteraction> {
|
|
6
|
+
/**
|
|
7
|
+
* This is the options of the commands, parsed from the interaction data.
|
|
8
|
+
*/
|
|
9
|
+
options: AutocompleteOptionsHandler;
|
|
10
|
+
constructor(client: Client, data: APIApplicationCommandAutocompleteInteraction, defaults: InteractionDefaults);
|
|
11
|
+
defer(): Promise<void>;
|
|
12
|
+
reply(): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Respond with the choices for an autocomplete interaction
|
|
15
|
+
*/
|
|
16
|
+
respond(choices: {
|
|
17
|
+
/**
|
|
18
|
+
* The name of the choice, this is what the user will see
|
|
19
|
+
*/
|
|
20
|
+
name: string;
|
|
21
|
+
/**
|
|
22
|
+
* The value of the choice, this is what the bot will receive from Discord as the value
|
|
23
|
+
*/
|
|
24
|
+
value: string;
|
|
25
|
+
}[]): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export declare class AutocompleteOptionsHandler extends OptionsHandler {
|
|
28
|
+
/**
|
|
29
|
+
* Get the focused option (the one that is being autocompleted)
|
|
30
|
+
*/
|
|
31
|
+
getFocused(): string | number | boolean | null | undefined;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=AutocompleteInteraction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutocompleteInteraction.d.ts","sourceRoot":"","sources":["../../../src/internals/AutocompleteInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,4CAA4C,EAMjD,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,eAAe,EACf,KAAK,mBAAmB,EACxB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,qBAAa,uBAAwB,SAAQ,eAAe,CAAC,4CAA4C,CAAC;IACzG;;OAEG;IACH,OAAO,EAAE,0BAA0B,CAAA;gBAElC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,4CAA4C,EAClD,QAAQ,EAAE,mBAAmB;IAgBf,KAAK;IAIL,KAAK;IAIpB;;OAEG;IACG,OAAO,CACZ,OAAO,EAAE;QACR;;WAEG;QACH,IAAI,EAAE,MAAM,CAAA;QACZ;;WAEG;QACH,KAAK,EAAE,MAAM,CAAA;KACb,EAAE;CAcJ;AAED,qBAAa,0BAA2B,SAAQ,cAAc;IAC7D;;OAEG;IACH,UAAU;CAgBV"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ApplicationCommandOptionType, ApplicationCommandType, InteractionResponseType, InteractionType, Routes } from "discord-api-types/v10";
|
|
2
|
+
import { BaseInteraction } from "../abstracts/BaseInteraction.js";
|
|
3
|
+
import { OptionsHandler } from "./OptionsHandler.js";
|
|
4
|
+
export class AutocompleteInteraction extends BaseInteraction {
|
|
5
|
+
/**
|
|
6
|
+
* This is the options of the commands, parsed from the interaction data.
|
|
7
|
+
*/
|
|
8
|
+
options;
|
|
9
|
+
constructor(client, data, defaults) {
|
|
10
|
+
super(client, data, defaults);
|
|
11
|
+
if (data.type !== InteractionType.ApplicationCommandAutocomplete) {
|
|
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
|
+
this.options = new AutocompleteOptionsHandler(client, data.data.options ?? []);
|
|
18
|
+
}
|
|
19
|
+
async defer() {
|
|
20
|
+
throw new Error("Defer is not available for autocomplete interactions");
|
|
21
|
+
}
|
|
22
|
+
async reply() {
|
|
23
|
+
throw new Error("Reply is not available for autocomplete interactions");
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Respond with the choices for an autocomplete interaction
|
|
27
|
+
*/
|
|
28
|
+
async respond(choices) {
|
|
29
|
+
await this.client.rest.post(Routes.interactionCallback(this.rawData.id, this.rawData.token), {
|
|
30
|
+
body: {
|
|
31
|
+
type: InteractionResponseType.ApplicationCommandAutocompleteResult,
|
|
32
|
+
data: {
|
|
33
|
+
choices
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export class AutocompleteOptionsHandler extends OptionsHandler {
|
|
40
|
+
/**
|
|
41
|
+
* Get the focused option (the one that is being autocompleted)
|
|
42
|
+
*/
|
|
43
|
+
getFocused() {
|
|
44
|
+
const focused = this.raw.find((x) => "focused" in x && x.focused);
|
|
45
|
+
if (!focused)
|
|
46
|
+
return null;
|
|
47
|
+
switch (focused.type) {
|
|
48
|
+
case ApplicationCommandOptionType.String:
|
|
49
|
+
return this.getString(focused.name);
|
|
50
|
+
case ApplicationCommandOptionType.Integer:
|
|
51
|
+
return this.getInteger(focused.name);
|
|
52
|
+
case ApplicationCommandOptionType.Number:
|
|
53
|
+
return this.getNumber(focused.name);
|
|
54
|
+
case ApplicationCommandOptionType.Boolean:
|
|
55
|
+
return this.getBoolean(focused.name);
|
|
56
|
+
default:
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=AutocompleteInteraction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutocompleteInteraction.js","sourceRoot":"","sources":["../../../src/internals/AutocompleteInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,4BAA4B,EAC5B,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,eAAe,EAEf,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,MAAM,OAAO,uBAAwB,SAAQ,eAA6D;IACzG;;OAEG;IACH,OAAO,CAA4B;IACnC,YACC,MAAc,EACd,IAAkD,EAClD,QAA6B;QAE7B,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;QAC7B,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe,CAAC,8BAA8B,EAAE,CAAC;YAClE,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;QAED,IAAI,CAAC,OAAO,GAAG,IAAI,0BAA0B,CAC5C,MAAM,EACN,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CACvB,CAAA;IACF,CAAC;IAEQ,KAAK,CAAC,KAAK;QACnB,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;IACxE,CAAC;IAEQ,KAAK,CAAC,KAAK;QACnB,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;IACxE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CACZ,OASG;QAEH,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAC1B,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAC/D;YACC,IAAI,EAAE;gBACL,IAAI,EAAE,uBAAuB,CAAC,oCAAoC;gBAClE,IAAI,EAAE;oBACL,OAAO;iBACP;aACD;SACD,CACD,CAAA;IACF,CAAC;CACD;AAED,MAAM,OAAO,0BAA2B,SAAQ,cAAc;IAC7D;;OAEG;IACH,UAAU;QACT,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAA;QACjE,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAA;QACzB,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;YACtB,KAAK,4BAA4B,CAAC,MAAM;gBACvC,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YACpC,KAAK,4BAA4B,CAAC,OAAO;gBACxC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YACrC,KAAK,4BAA4B,CAAC,MAAM;gBACvC,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YACpC,KAAK,4BAA4B,CAAC,OAAO;gBACxC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YACrC;gBACC,OAAO,IAAI,CAAA;QACb,CAAC;IACF,CAAC;CACD"}
|