necord 5.2.0-dev.1663245459.9f9fe8c → 5.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/commands/command.discovery.d.ts +8 -8
- package/dist/commands/command.discovery.js +13 -13
- package/dist/commands/commands.service.d.ts +14 -14
- package/dist/commands/commands.service.js +74 -74
- package/dist/commands/context-menus/context-menu.discovery.d.ts +11 -11
- package/dist/commands/context-menus/context-menu.discovery.js +19 -19
- package/dist/commands/context-menus/context-menus.service.d.ts +14 -14
- package/dist/commands/context-menus/context-menus.service.js +46 -46
- package/dist/commands/context-menus/decorators/context-menu.decorator.d.ts +2 -2
- package/dist/commands/context-menus/decorators/context-menu.decorator.js +8 -8
- package/dist/commands/context-menus/decorators/index.d.ts +4 -4
- package/dist/commands/context-menus/decorators/index.js +20 -20
- package/dist/commands/context-menus/decorators/message-command.decorator.d.ts +2 -2
- package/dist/commands/context-menus/decorators/message-command.decorator.js +7 -7
- package/dist/commands/context-menus/decorators/target.decorator.d.ts +1 -1
- package/dist/commands/context-menus/decorators/target.decorator.js +14 -14
- package/dist/commands/context-menus/decorators/user-command.decorator.d.ts +2 -2
- package/dist/commands/context-menus/decorators/user-command.decorator.js +7 -7
- package/dist/commands/context-menus/index.d.ts +3 -3
- package/dist/commands/context-menus/index.js +19 -19
- package/dist/commands/index.d.ts +4 -4
- package/dist/commands/index.js +20 -20
- package/dist/commands/slash-commands/autocomplete/autocomplete.interceptor.d.ts +7 -7
- package/dist/commands/slash-commands/autocomplete/autocomplete.interceptor.js +39 -39
- package/dist/commands/slash-commands/autocomplete/index.d.ts +1 -1
- package/dist/commands/slash-commands/autocomplete/index.js +17 -17
- package/dist/commands/slash-commands/decorators/index.d.ts +3 -3
- package/dist/commands/slash-commands/decorators/index.js +19 -19
- package/dist/commands/slash-commands/decorators/slash-command.decorator.d.ts +2 -2
- package/dist/commands/slash-commands/decorators/slash-command.decorator.js +9 -9
- package/dist/commands/slash-commands/decorators/subcommand-group.decorator.d.ts +2 -2
- package/dist/commands/slash-commands/decorators/subcommand-group.decorator.js +18 -18
- package/dist/commands/slash-commands/decorators/subcommand.decorator.d.ts +2 -2
- package/dist/commands/slash-commands/decorators/subcommand.decorator.js +9 -9
- package/dist/commands/slash-commands/index.d.ts +5 -5
- package/dist/commands/slash-commands/index.js +21 -21
- package/dist/commands/slash-commands/options/attachment-option.decorator.d.ts +7 -7
- package/dist/commands/slash-commands/options/attachment-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/boolean-option.decorator.d.ts +7 -7
- package/dist/commands/slash-commands/options/boolean-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/channel-option.decorator.d.ts +8 -8
- package/dist/commands/slash-commands/options/channel-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/index.d.ts +11 -11
- package/dist/commands/slash-commands/options/index.js +27 -27
- package/dist/commands/slash-commands/options/integer-option.decorator.d.ts +20 -20
- package/dist/commands/slash-commands/options/integer-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/member-option.decorator.d.ts +7 -7
- package/dist/commands/slash-commands/options/member-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/mentionable-option.decorator.d.ts +7 -7
- package/dist/commands/slash-commands/options/mentionable-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/number-option.decorator.d.ts +20 -20
- package/dist/commands/slash-commands/options/number-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/option.util.d.ts +5 -5
- package/dist/commands/slash-commands/options/option.util.js +21 -21
- package/dist/commands/slash-commands/options/options.decorator.d.ts +2 -2
- package/dist/commands/slash-commands/options/options.decorator.js +32 -32
- package/dist/commands/slash-commands/options/role-option.decorator.d.ts +7 -7
- package/dist/commands/slash-commands/options/role-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/string-option.decorator.d.ts +20 -20
- package/dist/commands/slash-commands/options/string-option.decorator.js +6 -6
- package/dist/commands/slash-commands/options/user-option.decorator.d.ts +7 -7
- package/dist/commands/slash-commands/options/user-option.decorator.js +6 -6
- package/dist/commands/slash-commands/slash-command.discovery.d.ts +20 -20
- package/dist/commands/slash-commands/slash-command.discovery.js +44 -44
- package/dist/commands/slash-commands/slash-commands.service.d.ts +16 -16
- package/dist/commands/slash-commands/slash-commands.service.js +77 -77
- package/dist/context/decorators/context.decorator.d.ts +2 -2
- package/dist/context/decorators/context.decorator.js +7 -7
- package/dist/context/decorators/discovery.decorator.d.ts +1 -1
- package/dist/context/decorators/discovery.decorator.js +6 -6
- package/dist/context/decorators/index.d.ts +2 -2
- package/dist/context/decorators/index.js +18 -18
- package/dist/context/decorators/params.util.d.ts +3 -3
- package/dist/context/decorators/params.util.js +12 -12
- package/dist/context/index.d.ts +7 -7
- package/dist/context/index.js +23 -23
- package/dist/context/necord-arguments-host.d.ts +13 -13
- package/dist/context/necord-arguments-host.js +22 -22
- package/dist/context/necord-base.discovery.d.ts +30 -30
- package/dist/context/necord-base.discovery.js +47 -47
- package/dist/context/necord-context.interface.d.ts +11 -11
- package/dist/context/necord-context.interface.js +2 -2
- package/dist/context/necord-execution-context.d.ts +6 -6
- package/dist/context/necord-execution-context.js +13 -13
- package/dist/context/necord-params.factory.d.ts +6 -6
- package/dist/context/necord-params.factory.js +19 -19
- package/dist/context/necord-paramtype.enum.d.ts +4 -4
- package/dist/context/necord-paramtype.enum.js +8 -8
- package/dist/index.d.ts +9 -9
- package/dist/index.js +25 -25
- package/dist/listeners/decorators/index.d.ts +3 -3
- package/dist/listeners/decorators/index.js +19 -19
- package/dist/listeners/decorators/listener.decorator.d.ts +2 -2
- package/dist/listeners/decorators/listener.decorator.js +8 -8
- package/dist/listeners/decorators/on.decorator.d.ts +2 -2
- package/dist/listeners/decorators/on.decorator.js +6 -6
- package/dist/listeners/decorators/once.decorator.d.ts +2 -2
- package/dist/listeners/decorators/once.decorator.js +6 -6
- package/dist/listeners/index.d.ts +3 -3
- package/dist/listeners/index.js +19 -19
- package/dist/listeners/listener.discovery.d.ts +11 -11
- package/dist/listeners/listener.discovery.js +19 -19
- package/dist/listeners/listener.interface.d.ts +90 -90
- package/dist/listeners/listener.interface.js +2 -2
- package/dist/listeners/listeners.service.d.ts +22 -22
- package/dist/listeners/listeners.service.js +237 -237
- package/dist/message-components/decorators/button.decorator.d.ts +1 -1
- package/dist/message-components/decorators/button.decorator.js +7 -7
- package/dist/message-components/decorators/component-param.decorator.d.ts +1 -1
- package/dist/message-components/decorators/component-param.decorator.js +17 -17
- package/dist/message-components/decorators/index.d.ts +5 -5
- package/dist/message-components/decorators/index.js +21 -21
- package/dist/message-components/decorators/message-component.decorator.d.ts +2 -2
- package/dist/message-components/decorators/message-component.decorator.js +8 -8
- package/dist/message-components/decorators/select-menu.decorator.d.ts +1 -1
- package/dist/message-components/decorators/select-menu.decorator.js +7 -7
- package/dist/message-components/decorators/values.decorator.d.ts +1 -1
- package/dist/message-components/decorators/values.decorator.js +10 -10
- package/dist/message-components/index.d.ts +3 -3
- package/dist/message-components/index.js +19 -19
- package/dist/message-components/message-component.discovery.d.ts +14 -14
- package/dist/message-components/message-component.discovery.js +27 -27
- package/dist/message-components/message-components.service.d.ts +12 -12
- package/dist/message-components/message-components.service.js +46 -46
- package/dist/modals/decorators/fields.decorator.d.ts +1 -1
- package/dist/modals/decorators/fields.decorator.js +14 -14
- package/dist/modals/decorators/index.d.ts +3 -3
- package/dist/modals/decorators/index.js +19 -19
- package/dist/modals/decorators/modal-param.decorator.d.ts +1 -1
- package/dist/modals/decorators/modal-param.decorator.js +17 -17
- package/dist/modals/decorators/modal.decorator.d.ts +1 -1
- package/dist/modals/decorators/modal.decorator.js +8 -8
- package/dist/modals/index.d.ts +3 -3
- package/dist/modals/index.js +19 -19
- package/dist/modals/modal.discovery.d.ts +12 -12
- package/dist/modals/modal.discovery.js +24 -24
- package/dist/modals/modals.service.d.ts +12 -12
- package/dist/modals/modals.service.js +46 -46
- package/dist/necord-client.provider.d.ts +3 -3
- package/dist/necord-client.provider.js +10 -10
- package/dist/necord-explorer.service.d.ts +15 -15
- package/dist/necord-explorer.service.js +59 -59
- package/dist/necord-options.interface.d.ts +16 -16
- package/dist/necord-options.interface.js +2 -2
- package/dist/necord.constants.d.ts +11 -11
- package/dist/necord.constants.js +14 -14
- package/dist/necord.module.d.ts +14 -14
- package/dist/necord.module.js +115 -115
- package/dist/text-commands/decorators/arguments.decorator.d.ts +2 -2
- package/dist/text-commands/decorators/arguments.decorator.js +14 -14
- package/dist/text-commands/decorators/index.d.ts +2 -2
- package/dist/text-commands/decorators/index.js +18 -18
- package/dist/text-commands/decorators/text-command.decorator.d.ts +2 -2
- package/dist/text-commands/decorators/text-command.decorator.js +8 -8
- package/dist/text-commands/index.d.ts +3 -3
- package/dist/text-commands/index.js +19 -19
- package/dist/text-commands/text-command.discovery.d.ts +11 -11
- package/dist/text-commands/text-command.discovery.js +19 -19
- package/dist/text-commands/text-commands.service.d.ts +14 -14
- package/dist/text-commands/text-commands.service.js +66 -66
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IntegerOption = void 0;
|
|
4
|
-
const discord_js_1 = require("discord.js");
|
|
5
|
-
const option_util_1 = require("./option.util");
|
|
6
|
-
exports.IntegerOption = (0, option_util_1.createOptionDecorator)(discord_js_1.ApplicationCommandOptionType.Integer, 'getInteger');
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntegerOption = void 0;
|
|
4
|
+
const discord_js_1 = require("discord.js");
|
|
5
|
+
const option_util_1 = require("./option.util");
|
|
6
|
+
exports.IntegerOption = (0, option_util_1.createOptionDecorator)(discord_js_1.ApplicationCommandOptionType.Integer, 'getInteger');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const MemberOption: (data: {
|
|
2
|
-
name: string;
|
|
3
|
-
description: string;
|
|
4
|
-
name_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
5
|
-
description_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
6
|
-
required?: boolean;
|
|
7
|
-
}) => PropertyDecorator;
|
|
1
|
+
export declare const MemberOption: (data: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
name_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
5
|
+
description_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
}) => PropertyDecorator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MemberOption = void 0;
|
|
4
|
-
const discord_js_1 = require("discord.js");
|
|
5
|
-
const option_util_1 = require("./option.util");
|
|
6
|
-
exports.MemberOption = (0, option_util_1.createOptionDecorator)(discord_js_1.ApplicationCommandOptionType.User, 'getMember');
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemberOption = void 0;
|
|
4
|
+
const discord_js_1 = require("discord.js");
|
|
5
|
+
const option_util_1 = require("./option.util");
|
|
6
|
+
exports.MemberOption = (0, option_util_1.createOptionDecorator)(discord_js_1.ApplicationCommandOptionType.User, 'getMember');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const MentionableOption: (data: {
|
|
2
|
-
name: string;
|
|
3
|
-
description: string;
|
|
4
|
-
name_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
5
|
-
description_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
6
|
-
required?: boolean;
|
|
7
|
-
}) => PropertyDecorator;
|
|
1
|
+
export declare const MentionableOption: (data: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
name_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
5
|
+
description_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
}) => PropertyDecorator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MentionableOption = void 0;
|
|
4
|
-
const discord_js_1 = require("discord.js");
|
|
5
|
-
const option_util_1 = require("./option.util");
|
|
6
|
-
exports.MentionableOption = (0, option_util_1.createOptionDecorator)(discord_js_1.ApplicationCommandOptionType.Mentionable, 'getMentionable');
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MentionableOption = void 0;
|
|
4
|
+
const discord_js_1 = require("discord.js");
|
|
5
|
+
const option_util_1 = require("./option.util");
|
|
6
|
+
exports.MentionableOption = (0, option_util_1.createOptionDecorator)(discord_js_1.ApplicationCommandOptionType.Mentionable, 'getMentionable');
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export declare const NumberOption: (data: {
|
|
2
|
-
name: string;
|
|
3
|
-
description: string;
|
|
4
|
-
name_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
5
|
-
description_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
6
|
-
required?: boolean;
|
|
7
|
-
min_value?: number;
|
|
8
|
-
max_value?: number;
|
|
9
|
-
autocomplete: true;
|
|
10
|
-
} | {
|
|
11
|
-
name: string;
|
|
12
|
-
description: string;
|
|
13
|
-
name_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
14
|
-
description_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
15
|
-
required?: boolean;
|
|
16
|
-
min_value?: number;
|
|
17
|
-
max_value?: number;
|
|
18
|
-
autocomplete?: false;
|
|
19
|
-
choices?: import("discord.js").APIApplicationCommandOptionChoice<number>[];
|
|
20
|
-
}) => PropertyDecorator;
|
|
1
|
+
export declare const NumberOption: (data: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
name_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
5
|
+
description_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
min_value?: number;
|
|
8
|
+
max_value?: number;
|
|
9
|
+
autocomplete: true;
|
|
10
|
+
} | {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
name_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
14
|
+
description_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
min_value?: number;
|
|
17
|
+
max_value?: number;
|
|
18
|
+
autocomplete?: false;
|
|
19
|
+
choices?: import("discord.js").APIApplicationCommandOptionChoice<number>[];
|
|
20
|
+
}) => PropertyDecorator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NumberOption = void 0;
|
|
4
|
-
const discord_js_1 = require("discord.js");
|
|
5
|
-
const option_util_1 = require("./option.util");
|
|
6
|
-
exports.NumberOption = (0, option_util_1.createOptionDecorator)(discord_js_1.ApplicationCommandOptionType.Number, 'getNumber');
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NumberOption = void 0;
|
|
4
|
+
const discord_js_1 = require("discord.js");
|
|
5
|
+
const option_util_1 = require("./option.util");
|
|
6
|
+
exports.NumberOption = (0, option_util_1.createOptionDecorator)(discord_js_1.ApplicationCommandOptionType.Number, 'getNumber');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { APIApplicationCommandOptionBase } from 'discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base';
|
|
2
|
-
import { ApplicationCommandOptionType } from 'discord.js';
|
|
3
|
-
import { OptionMeta } from '../slash-command.discovery';
|
|
4
|
-
import { DistributiveOmit } from 'discord-api-types/utils/internals';
|
|
5
|
-
export declare function createOptionDecorator<T extends APIApplicationCommandOptionBase<any>>(type: ApplicationCommandOptionType, resolver: OptionMeta['resolver']): (data: DistributiveOmit<T, 'type'>) => PropertyDecorator;
|
|
1
|
+
import { APIApplicationCommandOptionBase } from 'discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base';
|
|
2
|
+
import { ApplicationCommandOptionType } from 'discord.js';
|
|
3
|
+
import { OptionMeta } from '../slash-command.discovery';
|
|
4
|
+
import { DistributiveOmit } from 'discord-api-types/utils/internals';
|
|
5
|
+
export declare function createOptionDecorator<T extends APIApplicationCommandOptionBase<any>>(type: ApplicationCommandOptionType, resolver: OptionMeta['resolver']): (data: DistributiveOmit<T, 'type'>) => PropertyDecorator;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createOptionDecorator = void 0;
|
|
4
|
-
const necord_constants_1 = require("../../../necord.constants");
|
|
5
|
-
function createOptionDecorator(type, resolver) {
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
7
|
-
// @ts-ignore
|
|
8
|
-
return (data) => {
|
|
9
|
-
return (target, propertyKey) => {
|
|
10
|
-
Reflect.defineProperty(target, propertyKey, {
|
|
11
|
-
value: undefined,
|
|
12
|
-
writable: true,
|
|
13
|
-
configurable: true
|
|
14
|
-
});
|
|
15
|
-
const meta = Object.assign(Object.assign({}, data), { type,
|
|
16
|
-
resolver });
|
|
17
|
-
Reflect.defineMetadata(necord_constants_1.OPTIONS_METADATA, meta, target, propertyKey);
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
exports.createOptionDecorator = createOptionDecorator;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createOptionDecorator = void 0;
|
|
4
|
+
const necord_constants_1 = require("../../../necord.constants");
|
|
5
|
+
function createOptionDecorator(type, resolver) {
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
return (data) => {
|
|
9
|
+
return (target, propertyKey) => {
|
|
10
|
+
Reflect.defineProperty(target, propertyKey, {
|
|
11
|
+
value: undefined,
|
|
12
|
+
writable: true,
|
|
13
|
+
configurable: true
|
|
14
|
+
});
|
|
15
|
+
const meta = Object.assign(Object.assign({}, data), { type,
|
|
16
|
+
resolver });
|
|
17
|
+
Reflect.defineMetadata(necord_constants_1.OPTIONS_METADATA, meta, target, propertyKey);
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
exports.createOptionDecorator = createOptionDecorator;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const Options: (...dataOrPipes: any[]) => ParameterDecorator;
|
|
2
|
-
export declare const Opts: (...dataOrPipes: any[]) => ParameterDecorator;
|
|
1
|
+
export declare const Options: (...dataOrPipes: any[]) => ParameterDecorator;
|
|
2
|
+
export declare const Opts: (...dataOrPipes: any[]) => ParameterDecorator;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Opts = exports.Options = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
const context_1 = require("../../../context");
|
|
6
|
-
const necord_constants_1 = require("../../../necord.constants");
|
|
7
|
-
exports.Options = (0, common_1.createParamDecorator)((_, context) => {
|
|
8
|
-
const necordContext = context_1.NecordExecutionContext.create(context);
|
|
9
|
-
const [interaction] = necordContext.getContext();
|
|
10
|
-
const discovery = necordContext.getDiscovery();
|
|
11
|
-
if (!discovery.isSlashCommand())
|
|
12
|
-
return null;
|
|
13
|
-
return Object.entries(discovery.getRawOptions()).reduce((acc, [parameter, option]) => {
|
|
14
|
-
acc[parameter] = interaction.options[option.resolver].call(interaction.options, option.name, !!option.required);
|
|
15
|
-
return acc;
|
|
16
|
-
}, {});
|
|
17
|
-
}, [
|
|
18
|
-
(target, propertyKey, parameterIndex) => {
|
|
19
|
-
const paramTypes = Reflect.getMetadata('design:paramtypes', target, propertyKey);
|
|
20
|
-
let { prototype } = paramTypes[parameterIndex];
|
|
21
|
-
const options = {};
|
|
22
|
-
do {
|
|
23
|
-
Object.getOwnPropertyNames(prototype)
|
|
24
|
-
.map(name => [name, Reflect.getMetadata(necord_constants_1.OPTIONS_METADATA, prototype, name)])
|
|
25
|
-
.filter(([, meta]) => !!meta)
|
|
26
|
-
.forEach(([name, meta]) => { var _a; return ((_a = options[name]) !== null && _a !== void 0 ? _a : (options[name] = meta)); });
|
|
27
|
-
} while ((prototype = Reflect.getPrototypeOf(prototype)) &&
|
|
28
|
-
prototype !== Object.prototype);
|
|
29
|
-
Reflect.defineMetadata(necord_constants_1.OPTIONS_METADATA, options, target[propertyKey]);
|
|
30
|
-
}
|
|
31
|
-
]);
|
|
32
|
-
exports.Opts = exports.Options;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Opts = exports.Options = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const context_1 = require("../../../context");
|
|
6
|
+
const necord_constants_1 = require("../../../necord.constants");
|
|
7
|
+
exports.Options = (0, common_1.createParamDecorator)((_, context) => {
|
|
8
|
+
const necordContext = context_1.NecordExecutionContext.create(context);
|
|
9
|
+
const [interaction] = necordContext.getContext();
|
|
10
|
+
const discovery = necordContext.getDiscovery();
|
|
11
|
+
if (!discovery.isSlashCommand())
|
|
12
|
+
return null;
|
|
13
|
+
return Object.entries(discovery.getRawOptions()).reduce((acc, [parameter, option]) => {
|
|
14
|
+
acc[parameter] = interaction.options[option.resolver].call(interaction.options, option.name, !!option.required);
|
|
15
|
+
return acc;
|
|
16
|
+
}, {});
|
|
17
|
+
}, [
|
|
18
|
+
(target, propertyKey, parameterIndex) => {
|
|
19
|
+
const paramTypes = Reflect.getMetadata('design:paramtypes', target, propertyKey);
|
|
20
|
+
let { prototype } = paramTypes[parameterIndex];
|
|
21
|
+
const options = {};
|
|
22
|
+
do {
|
|
23
|
+
Object.getOwnPropertyNames(prototype)
|
|
24
|
+
.map(name => [name, Reflect.getMetadata(necord_constants_1.OPTIONS_METADATA, prototype, name)])
|
|
25
|
+
.filter(([, meta]) => !!meta)
|
|
26
|
+
.forEach(([name, meta]) => { var _a; return ((_a = options[name]) !== null && _a !== void 0 ? _a : (options[name] = meta)); });
|
|
27
|
+
} while ((prototype = Reflect.getPrototypeOf(prototype)) &&
|
|
28
|
+
prototype !== Object.prototype);
|
|
29
|
+
Reflect.defineMetadata(necord_constants_1.OPTIONS_METADATA, options, target[propertyKey]);
|
|
30
|
+
}
|
|
31
|
+
]);
|
|
32
|
+
exports.Opts = exports.Options;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const RoleOption: (data: {
|
|
2
|
-
name: string;
|
|
3
|
-
description: string;
|
|
4
|
-
name_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
5
|
-
description_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
6
|
-
required?: boolean;
|
|
7
|
-
}) => PropertyDecorator;
|
|
1
|
+
export declare const RoleOption: (data: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
name_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
5
|
+
description_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
}) => PropertyDecorator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RoleOption = void 0;
|
|
4
|
-
const discord_js_1 = require("discord.js");
|
|
5
|
-
const option_util_1 = require("./option.util");
|
|
6
|
-
exports.RoleOption = (0, option_util_1.createOptionDecorator)(discord_js_1.ApplicationCommandOptionType.Role, 'getRole');
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RoleOption = void 0;
|
|
4
|
+
const discord_js_1 = require("discord.js");
|
|
5
|
+
const option_util_1 = require("./option.util");
|
|
6
|
+
exports.RoleOption = (0, option_util_1.createOptionDecorator)(discord_js_1.ApplicationCommandOptionType.Role, 'getRole');
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export declare const StringOption: (data: {
|
|
2
|
-
name: string;
|
|
3
|
-
description: string;
|
|
4
|
-
name_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
5
|
-
description_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
6
|
-
required?: boolean;
|
|
7
|
-
autocomplete: true;
|
|
8
|
-
min_length?: number;
|
|
9
|
-
max_length?: number;
|
|
10
|
-
} | {
|
|
11
|
-
name: string;
|
|
12
|
-
description: string;
|
|
13
|
-
name_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
14
|
-
description_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
15
|
-
required?: boolean;
|
|
16
|
-
autocomplete?: false;
|
|
17
|
-
choices?: import("discord.js").APIApplicationCommandOptionChoice<string>[];
|
|
18
|
-
min_length?: number;
|
|
19
|
-
max_length?: number;
|
|
20
|
-
}) => PropertyDecorator;
|
|
1
|
+
export declare const StringOption: (data: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
name_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
5
|
+
description_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
autocomplete: true;
|
|
8
|
+
min_length?: number;
|
|
9
|
+
max_length?: number;
|
|
10
|
+
} | {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
name_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
14
|
+
description_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
autocomplete?: false;
|
|
17
|
+
choices?: import("discord.js").APIApplicationCommandOptionChoice<string>[];
|
|
18
|
+
min_length?: number;
|
|
19
|
+
max_length?: number;
|
|
20
|
+
}) => PropertyDecorator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StringOption = void 0;
|
|
4
|
-
const discord_js_1 = require("discord.js");
|
|
5
|
-
const option_util_1 = require("./option.util");
|
|
6
|
-
exports.StringOption = (0, option_util_1.createOptionDecorator)(discord_js_1.ApplicationCommandOptionType.String, 'getString');
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StringOption = void 0;
|
|
4
|
+
const discord_js_1 = require("discord.js");
|
|
5
|
+
const option_util_1 = require("./option.util");
|
|
6
|
+
exports.StringOption = (0, option_util_1.createOptionDecorator)(discord_js_1.ApplicationCommandOptionType.String, 'getString');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const UserOption: (data: {
|
|
2
|
-
name: string;
|
|
3
|
-
description: string;
|
|
4
|
-
name_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
5
|
-
description_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
6
|
-
required?: boolean;
|
|
7
|
-
}) => PropertyDecorator;
|
|
1
|
+
export declare const UserOption: (data: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
name_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
5
|
+
description_localizations?: Partial<Record<"en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "sv-SE" | "th" | "tr" | "uk" | "vi", string>>;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
}) => PropertyDecorator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserOption = void 0;
|
|
4
|
-
const discord_js_1 = require("discord.js");
|
|
5
|
-
const option_util_1 = require("./option.util");
|
|
6
|
-
exports.UserOption = (0, option_util_1.createOptionDecorator)(discord_js_1.ApplicationCommandOptionType.User, 'getUser');
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserOption = void 0;
|
|
4
|
+
const discord_js_1 = require("discord.js");
|
|
5
|
+
const option_util_1 = require("./option.util");
|
|
6
|
+
exports.UserOption = (0, option_util_1.createOptionDecorator)(discord_js_1.ApplicationCommandOptionType.User, 'getUser');
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ApplicationCommandOptionType, ApplicationCommandType, AutocompleteInteraction, ChatInputApplicationCommandData, ChatInputCommandInteraction, CommandInteractionOptionResolver, Snowflake } from 'discord.js';
|
|
2
|
-
import { APIApplicationCommandOptionBase } from 'discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base';
|
|
3
|
-
import { CommandDiscovery } from '../command.discovery';
|
|
4
|
-
export interface SlashCommandMeta extends ChatInputApplicationCommandData {
|
|
5
|
-
type?: ApplicationCommandType.ChatInput | ApplicationCommandOptionType.SubcommandGroup | ApplicationCommandOptionType.Subcommand;
|
|
6
|
-
guilds?: Snowflake[];
|
|
7
|
-
}
|
|
8
|
-
export interface OptionMeta extends APIApplicationCommandOptionBase<any> {
|
|
9
|
-
resolver?: keyof CommandInteractionOptionResolver;
|
|
10
|
-
}
|
|
11
|
-
export declare class SlashCommandDiscovery extends CommandDiscovery<SlashCommandMeta> {
|
|
12
|
-
private readonly subcommands;
|
|
13
|
-
getDescription(): string;
|
|
14
|
-
setCommand(command: SlashCommandDiscovery): void;
|
|
15
|
-
getRawOptions(): Record<string, OptionMeta>;
|
|
16
|
-
getOptions(): any;
|
|
17
|
-
execute(interaction: ChatInputCommandInteraction | AutocompleteInteraction, depth?: number): any;
|
|
18
|
-
isSlashCommand(): this is SlashCommandDiscovery;
|
|
19
|
-
toJSON(): any;
|
|
20
|
-
}
|
|
1
|
+
import { ApplicationCommandOptionType, ApplicationCommandType, AutocompleteInteraction, ChatInputApplicationCommandData, ChatInputCommandInteraction, CommandInteractionOptionResolver, Snowflake } from 'discord.js';
|
|
2
|
+
import { APIApplicationCommandOptionBase } from 'discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/base';
|
|
3
|
+
import { CommandDiscovery } from '../command.discovery';
|
|
4
|
+
export interface SlashCommandMeta extends ChatInputApplicationCommandData {
|
|
5
|
+
type?: ApplicationCommandType.ChatInput | ApplicationCommandOptionType.SubcommandGroup | ApplicationCommandOptionType.Subcommand;
|
|
6
|
+
guilds?: Snowflake[];
|
|
7
|
+
}
|
|
8
|
+
export interface OptionMeta extends APIApplicationCommandOptionBase<any> {
|
|
9
|
+
resolver?: keyof CommandInteractionOptionResolver;
|
|
10
|
+
}
|
|
11
|
+
export declare class SlashCommandDiscovery extends CommandDiscovery<SlashCommandMeta> {
|
|
12
|
+
private readonly subcommands;
|
|
13
|
+
getDescription(): string;
|
|
14
|
+
setCommand(command: SlashCommandDiscovery): void;
|
|
15
|
+
getRawOptions(): Record<string, OptionMeta>;
|
|
16
|
+
getOptions(): any;
|
|
17
|
+
execute(interaction: ChatInputCommandInteraction | AutocompleteInteraction, depth?: number): any;
|
|
18
|
+
isSlashCommand(): this is SlashCommandDiscovery;
|
|
19
|
+
toJSON(): any;
|
|
20
|
+
}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SlashCommandDiscovery = void 0;
|
|
4
|
-
const necord_constants_1 = require("../../necord.constants");
|
|
5
|
-
const command_discovery_1 = require("../command.discovery");
|
|
6
|
-
class SlashCommandDiscovery extends command_discovery_1.CommandDiscovery {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this.subcommands = new Map();
|
|
10
|
-
}
|
|
11
|
-
getDescription() {
|
|
12
|
-
return this.meta.description;
|
|
13
|
-
}
|
|
14
|
-
setCommand(command) {
|
|
15
|
-
this.subcommands.set(command.getName(), command);
|
|
16
|
-
}
|
|
17
|
-
getRawOptions() {
|
|
18
|
-
var _a;
|
|
19
|
-
return (_a = this.reflector.get(necord_constants_1.OPTIONS_METADATA, this.getHandler())) !== null && _a !== void 0 ? _a : {};
|
|
20
|
-
}
|
|
21
|
-
getOptions() {
|
|
22
|
-
if (this.subcommands.size >= 1) {
|
|
23
|
-
return [...this.subcommands.values()].map(subcommand => subcommand.toJSON());
|
|
24
|
-
}
|
|
25
|
-
return Object.values(this.getRawOptions());
|
|
26
|
-
}
|
|
27
|
-
execute(interaction, depth = 1) {
|
|
28
|
-
var _a, _b;
|
|
29
|
-
if (this.subcommands.size >= 1) {
|
|
30
|
-
const commandName = depth === 2
|
|
31
|
-
? interaction.options.getSubcommand(true)
|
|
32
|
-
: (_a = interaction.options.getSubcommandGroup(false)) !== null && _a !== void 0 ? _a : interaction.options.getSubcommand(true);
|
|
33
|
-
return (_b = this.subcommands.get(commandName)) === null || _b === void 0 ? void 0 : _b.execute(interaction, depth + 1);
|
|
34
|
-
}
|
|
35
|
-
return super.execute([interaction]);
|
|
36
|
-
}
|
|
37
|
-
isSlashCommand() {
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
toJSON() {
|
|
41
|
-
return Object.assign(Object.assign({}, this.meta), { options: this.getOptions() });
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.SlashCommandDiscovery = SlashCommandDiscovery;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlashCommandDiscovery = void 0;
|
|
4
|
+
const necord_constants_1 = require("../../necord.constants");
|
|
5
|
+
const command_discovery_1 = require("../command.discovery");
|
|
6
|
+
class SlashCommandDiscovery extends command_discovery_1.CommandDiscovery {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.subcommands = new Map();
|
|
10
|
+
}
|
|
11
|
+
getDescription() {
|
|
12
|
+
return this.meta.description;
|
|
13
|
+
}
|
|
14
|
+
setCommand(command) {
|
|
15
|
+
this.subcommands.set(command.getName(), command);
|
|
16
|
+
}
|
|
17
|
+
getRawOptions() {
|
|
18
|
+
var _a;
|
|
19
|
+
return (_a = this.reflector.get(necord_constants_1.OPTIONS_METADATA, this.getHandler())) !== null && _a !== void 0 ? _a : {};
|
|
20
|
+
}
|
|
21
|
+
getOptions() {
|
|
22
|
+
if (this.subcommands.size >= 1) {
|
|
23
|
+
return [...this.subcommands.values()].map(subcommand => subcommand.toJSON());
|
|
24
|
+
}
|
|
25
|
+
return Object.values(this.getRawOptions());
|
|
26
|
+
}
|
|
27
|
+
execute(interaction, depth = 1) {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
if (this.subcommands.size >= 1) {
|
|
30
|
+
const commandName = depth === 2
|
|
31
|
+
? interaction.options.getSubcommand(true)
|
|
32
|
+
: (_a = interaction.options.getSubcommandGroup(false)) !== null && _a !== void 0 ? _a : interaction.options.getSubcommand(true);
|
|
33
|
+
return (_b = this.subcommands.get(commandName)) === null || _b === void 0 ? void 0 : _b.execute(interaction, depth + 1);
|
|
34
|
+
}
|
|
35
|
+
return super.execute([interaction]);
|
|
36
|
+
}
|
|
37
|
+
isSlashCommand() {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
toJSON() {
|
|
41
|
+
return Object.assign(Object.assign({}, this.meta), { options: this.getOptions() });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.SlashCommandDiscovery = SlashCommandDiscovery;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { OnApplicationBootstrap, OnModuleInit } from '@nestjs/common';
|
|
2
|
-
import { SlashCommandDiscovery } from './slash-command.discovery';
|
|
3
|
-
import { Client } from 'discord.js';
|
|
4
|
-
import { ExplorerService } from '../../necord-explorer.service';
|
|
5
|
-
import { CommandDiscovery } from '../command.discovery';
|
|
6
|
-
import { Reflector } from '@nestjs/core';
|
|
7
|
-
export declare class SlashCommandsService implements OnModuleInit, OnApplicationBootstrap {
|
|
8
|
-
private readonly client;
|
|
9
|
-
private readonly explorerService;
|
|
10
|
-
private readonly reflector;
|
|
11
|
-
private readonly slashCommands;
|
|
12
|
-
constructor(client: Client, explorerService: ExplorerService<SlashCommandDiscovery>, reflector: Reflector);
|
|
13
|
-
onModuleInit(): Promise<void>;
|
|
14
|
-
onApplicationBootstrap(): Client<boolean>;
|
|
15
|
-
getCommands(): CommandDiscovery[];
|
|
16
|
-
}
|
|
1
|
+
import { OnApplicationBootstrap, OnModuleInit } from '@nestjs/common';
|
|
2
|
+
import { SlashCommandDiscovery } from './slash-command.discovery';
|
|
3
|
+
import { Client } from 'discord.js';
|
|
4
|
+
import { ExplorerService } from '../../necord-explorer.service';
|
|
5
|
+
import { CommandDiscovery } from '../command.discovery';
|
|
6
|
+
import { Reflector } from '@nestjs/core';
|
|
7
|
+
export declare class SlashCommandsService implements OnModuleInit, OnApplicationBootstrap {
|
|
8
|
+
private readonly client;
|
|
9
|
+
private readonly explorerService;
|
|
10
|
+
private readonly reflector;
|
|
11
|
+
private readonly slashCommands;
|
|
12
|
+
constructor(client: Client, explorerService: ExplorerService<SlashCommandDiscovery>, reflector: Reflector);
|
|
13
|
+
onModuleInit(): Promise<void>;
|
|
14
|
+
onApplicationBootstrap(): Client<boolean>;
|
|
15
|
+
getCommands(): CommandDiscovery[];
|
|
16
|
+
}
|