necord 4.2.7 → 4.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/context/index.js +1 -5
- package/dist/context/necord-info-type.enum.d.ts +2 -1
- package/dist/context/necord-info-type.enum.js +1 -0
- package/dist/decorators/index.d.ts +1 -0
- package/dist/decorators/index.js +2 -5
- package/dist/decorators/modals.decorator.d.ts +1 -0
- package/dist/decorators/modals.decorator.js +7 -0
- package/dist/decorators/options.decorator.d.ts +5 -0
- package/dist/decorators/options.decorator.js +2 -1
- package/dist/exceptions/index.js +1 -5
- package/dist/index.js +1 -5
- package/dist/interfaces/index.js +1 -5
- package/dist/interfaces/necord-metadata.interface.d.ts +5 -2
- package/dist/necord-explorer.d.ts +2 -1
- package/dist/necord-explorer.js +2 -0
- package/dist/necord-interaction.update.js +9 -5
- package/dist/necord-registry.d.ts +4 -1
- package/dist/necord-registry.js +7 -0
- package/dist/necord.constants.d.ts +2 -1
- package/dist/necord.constants.js +3 -2
- package/dist/necord.module.js +2 -1
- package/package.json +3 -3
package/dist/context/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
|
@@ -8,4 +8,5 @@ var NecordInfoType;
|
|
|
8
8
|
NecordInfoType[NecordInfoType["CONTEXT_MENU"] = 2] = "CONTEXT_MENU";
|
|
9
9
|
NecordInfoType[NecordInfoType["MESSAGE_COMPONENT"] = 3] = "MESSAGE_COMPONENT";
|
|
10
10
|
NecordInfoType[NecordInfoType["TEXT_COMMAND"] = 4] = "TEXT_COMMAND";
|
|
11
|
+
NecordInfoType[NecordInfoType["MODAL"] = 5] = "MODAL";
|
|
11
12
|
})(NecordInfoType = exports.NecordInfoType || (exports.NecordInfoType = {}));
|
|
@@ -3,5 +3,6 @@ export * from './commands.decorator';
|
|
|
3
3
|
export * from './components.decorator';
|
|
4
4
|
export * from './guilds.decorator';
|
|
5
5
|
export * from './listeners.decorator';
|
|
6
|
+
export * from './modals.decorator';
|
|
6
7
|
export * from './options.decorator';
|
|
7
8
|
export * from './params.decorator';
|
package/dist/decorators/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
|
@@ -19,5 +15,6 @@ __exportStar(require("./commands.decorator"), exports);
|
|
|
19
15
|
__exportStar(require("./components.decorator"), exports);
|
|
20
16
|
__exportStar(require("./guilds.decorator"), exports);
|
|
21
17
|
__exportStar(require("./listeners.decorator"), exports);
|
|
18
|
+
__exportStar(require("./modals.decorator"), exports);
|
|
22
19
|
__exportStar(require("./options.decorator"), exports);
|
|
23
20
|
__exportStar(require("./params.decorator"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Modal: (customId: string) => import("@nestjs/common").CustomDecorator<string>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Modal = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const necord_constants_1 = require("../necord.constants");
|
|
6
|
+
const Modal = (customId) => (0, common_1.SetMetadata)(necord_constants_1.MODALS_METADATA, { customId });
|
|
7
|
+
exports.Modal = Modal;
|
|
@@ -63,3 +63,8 @@ export declare const MentionableOption: (data: Omit<import("discord.js").Applica
|
|
|
63
63
|
} & {
|
|
64
64
|
methodName?: keyof import("discord.js").CommandInteractionOptionResolver<import("discord.js").CacheType>;
|
|
65
65
|
}, "type" | "methodName"> | Omit<never, "type" | "methodName"> | Omit<never, "type" | "methodName"> | Omit<never, "type" | "methodName"> | Omit<never, "type" | "methodName">) => PropertyDecorator;
|
|
66
|
+
export declare const AttachmentOption: (data: Omit<import("discord.js").ApplicationCommandNonOptionsData & {
|
|
67
|
+
type: "ATTACHMENT";
|
|
68
|
+
} & {
|
|
69
|
+
methodName?: keyof import("discord.js").CommandInteractionOptionResolver<import("discord.js").CacheType>;
|
|
70
|
+
}, "type" | "methodName"> | Omit<never, "type" | "methodName"> | Omit<never, "type" | "methodName"> | Omit<never, "type" | "methodName"> | Omit<never, "type" | "methodName">) => PropertyDecorator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MentionableOption = exports.RoleOption = exports.ChannelOption = exports.MemberOption = exports.UserOption = exports.StringOption = exports.NumberOption = exports.IntegerOption = exports.BooleanOption = void 0;
|
|
3
|
+
exports.AttachmentOption = exports.MentionableOption = exports.RoleOption = exports.ChannelOption = exports.MemberOption = exports.UserOption = exports.StringOption = exports.NumberOption = exports.IntegerOption = exports.BooleanOption = void 0;
|
|
4
4
|
const necord_constants_1 = require("../necord.constants");
|
|
5
5
|
exports.BooleanOption = createNecordOptionDecorator('BOOLEAN', 'getBoolean');
|
|
6
6
|
exports.IntegerOption = createNecordOptionDecorator('INTEGER', 'getInteger');
|
|
@@ -11,6 +11,7 @@ exports.MemberOption = createNecordOptionDecorator('USER', 'getMember');
|
|
|
11
11
|
exports.ChannelOption = createNecordOptionDecorator('CHANNEL', 'getChannel');
|
|
12
12
|
exports.RoleOption = createNecordOptionDecorator('ROLE', 'getRole');
|
|
13
13
|
exports.MentionableOption = createNecordOptionDecorator('MENTIONABLE', 'getMentionable');
|
|
14
|
+
exports.AttachmentOption = createNecordOptionDecorator('ATTACHMENT', 'getAttachment');
|
|
14
15
|
function createNecordOptionDecorator(type, methodName) {
|
|
15
16
|
return (data) => (target, propertyKey) => {
|
|
16
17
|
var _a;
|
package/dist/exceptions/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
package/dist/interfaces/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApplicationCommandData,
|
|
1
|
+
import { ApplicationCommandData, ApplicationCommandOptionChoiceData, ApplicationCommandOptionData, ApplicationCommandSubCommandData, ApplicationCommandSubGroupData, AutocompleteInteraction, ChatInputApplicationCommandData, CommandInteractionOptionResolver, MessageApplicationCommandData, MessageComponentType, UserApplicationCommandData } from 'discord.js';
|
|
2
2
|
import { NecordEvents } from './necord-events.interface';
|
|
3
3
|
import { Module } from '@nestjs/core/injector/module';
|
|
4
4
|
import { Type } from '@nestjs/common';
|
|
@@ -20,6 +20,9 @@ export interface ComponentMetadata extends BaseMetadata {
|
|
|
20
20
|
type: Exclude<MessageComponentType, 'ACTION_ROW'>;
|
|
21
21
|
customId: string;
|
|
22
22
|
}
|
|
23
|
+
export interface ModalMetadata extends BaseMetadata {
|
|
24
|
+
customId: string;
|
|
25
|
+
}
|
|
23
26
|
export interface TextCommandMetadata extends BaseMetadata {
|
|
24
27
|
name: string;
|
|
25
28
|
description?: string;
|
|
@@ -34,5 +37,5 @@ export declare type OptionMetadata<T extends CommandOptionData['type'] = any> =
|
|
|
34
37
|
methodName?: keyof CommandInteractionOptionResolver;
|
|
35
38
|
};
|
|
36
39
|
export interface TransformOptions {
|
|
37
|
-
transformOptions(interaction: AutocompleteInteraction, focused:
|
|
40
|
+
transformOptions(interaction: AutocompleteInteraction, focused: ApplicationCommandOptionChoiceData): ApplicationCommandOptionChoiceData[] | Promise<ApplicationCommandOptionChoiceData[]>;
|
|
38
41
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InstanceWrapper } from '@nestjs/core/injector/instance-wrapper';
|
|
2
2
|
import { DiscoveryService, MetadataScanner, Reflector } from '@nestjs/core';
|
|
3
3
|
import { ExternalContextCreator } from '@nestjs/core/helpers/external-context-creator';
|
|
4
|
-
import { ApplicationCommandMetadata, ComponentMetadata, ListenerMetadata, TextCommandMetadata } from './interfaces';
|
|
4
|
+
import { ApplicationCommandMetadata, ComponentMetadata, ListenerMetadata, ModalMetadata, TextCommandMetadata } from './interfaces';
|
|
5
5
|
declare type OptionMetadata = string | {
|
|
6
6
|
key: string;
|
|
7
7
|
fn: (key: string, targets: any[]) => unknown;
|
|
@@ -16,6 +16,7 @@ export declare class NecordExplorer {
|
|
|
16
16
|
constructor(discoveryService: DiscoveryService, externalContextCreator: ExternalContextCreator, metadataScanner: MetadataScanner, reflector: Reflector);
|
|
17
17
|
explore(): {
|
|
18
18
|
listeners: ListenerMetadata<keyof import("./interfaces").NecordEvents>[];
|
|
19
|
+
modals: ModalMetadata[];
|
|
19
20
|
components: ComponentMetadata[];
|
|
20
21
|
appCommands: ApplicationCommandMetadata[];
|
|
21
22
|
textCommands: TextCommandMetadata[];
|
package/dist/necord-explorer.js
CHANGED
|
@@ -34,6 +34,7 @@ let NecordExplorer = class NecordExplorer {
|
|
|
34
34
|
const listeners = this.flatMap(wrapper => this.filterProperties(wrapper, necord_constants_1.LISTENERS_METADATA));
|
|
35
35
|
const components = this.flatMap(wrapper => this.filterProperties(wrapper, necord_constants_1.MESSAGE_COMPONENT_METADATA));
|
|
36
36
|
const textCommands = this.flatMap(wrapper => this.filterProperties(wrapper, necord_constants_1.TEXT_COMMAND_METADATA));
|
|
37
|
+
const modals = this.flatMap(wrapper => this.filterProperties(wrapper, necord_constants_1.MODALS_METADATA));
|
|
37
38
|
const appCommands = this.flatMap(wrapper => {
|
|
38
39
|
var _a;
|
|
39
40
|
const commandGroup = this.filterProvider(wrapper, necord_constants_1.GROUP_METADATA);
|
|
@@ -69,6 +70,7 @@ let NecordExplorer = class NecordExplorer {
|
|
|
69
70
|
});
|
|
70
71
|
return {
|
|
71
72
|
listeners,
|
|
73
|
+
modals,
|
|
72
74
|
components,
|
|
73
75
|
appCommands,
|
|
74
76
|
textCommands
|
|
@@ -58,11 +58,15 @@ let NecordInteractionUpdate = NecordInteractionUpdate_1 = class NecordInteractio
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
onInteractionCreate([interaction]) {
|
|
61
|
-
var _a, _b;
|
|
61
|
+
var _a, _b, _c;
|
|
62
62
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
-
if (interaction.
|
|
63
|
+
if (interaction.isModalSubmit()) {
|
|
64
64
|
return (_a = this.registry
|
|
65
|
-
.
|
|
65
|
+
.getModal(interaction.customId)) === null || _a === void 0 ? void 0 : _a.metadata.execute(interaction, null, { type: context_1.NecordInfoType.MODAL });
|
|
66
|
+
}
|
|
67
|
+
if (interaction.isMessageComponent()) {
|
|
68
|
+
return (_b = this.registry
|
|
69
|
+
.getMessageComponent(interaction.componentType, interaction.customId)) === null || _b === void 0 ? void 0 : _b.metadata.execute([interaction], interaction.isSelectMenu() ? interaction.values : undefined, { type: context_1.NecordInfoType.MESSAGE_COMPONENT });
|
|
66
70
|
}
|
|
67
71
|
if (interaction.isContextMenu()) {
|
|
68
72
|
const options = interaction.isUserContextMenu()
|
|
@@ -71,8 +75,8 @@ let NecordInteractionUpdate = NecordInteractionUpdate_1 = class NecordInteractio
|
|
|
71
75
|
member: interaction.options.getMember('user', false)
|
|
72
76
|
}
|
|
73
77
|
: { message: interaction.options.getMessage('message', false) };
|
|
74
|
-
return (
|
|
75
|
-
.getContextMenu(interaction.targetType, interaction.commandName)) === null ||
|
|
78
|
+
return (_c = this.registry
|
|
79
|
+
.getContextMenu(interaction.targetType, interaction.commandName)) === null || _c === void 0 ? void 0 : _c.metadata.execute([interaction], options, {
|
|
76
80
|
type: context_1.NecordInfoType.CONTEXT_MENU
|
|
77
81
|
});
|
|
78
82
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Client } from 'discord.js';
|
|
2
|
-
import { ApplicationCommandMetadata, ComponentMetadata, ContextMenuMetadata, ListenerMetadata, SlashCommandMetadata, TextCommandMetadata } from './interfaces';
|
|
2
|
+
import { ApplicationCommandMetadata, ComponentMetadata, ContextMenuMetadata, ListenerMetadata, ModalMetadata, SlashCommandMetadata, TextCommandMetadata } from './interfaces';
|
|
3
3
|
export declare class NecordRegistry {
|
|
4
4
|
private readonly client;
|
|
5
5
|
private static readonly GENERATE_KEY;
|
|
@@ -7,8 +7,10 @@ export declare class NecordRegistry {
|
|
|
7
7
|
private readonly messageComponents;
|
|
8
8
|
private readonly applicationCommands;
|
|
9
9
|
private readonly applicationCommandsData;
|
|
10
|
+
private readonly modals;
|
|
10
11
|
constructor(client: Client);
|
|
11
12
|
registerListeners(listeners: ListenerMetadata[]): void;
|
|
13
|
+
addModals(modals: ModalMetadata[]): void;
|
|
12
14
|
addTextCommands(textCommands: TextCommandMetadata[]): void;
|
|
13
15
|
getTextCommands(): TextCommandMetadata[];
|
|
14
16
|
getTextCommand(name: string): TextCommandMetadata;
|
|
@@ -21,4 +23,5 @@ export declare class NecordRegistry {
|
|
|
21
23
|
getMessageComponent(componentType: ComponentMetadata['type'], customId: string): ComponentMetadata;
|
|
22
24
|
getButton(customId: string): ComponentMetadata;
|
|
23
25
|
getSelectMenu(customId: string): ComponentMetadata;
|
|
26
|
+
getModal(customId: string): ModalMetadata;
|
|
24
27
|
}
|
package/dist/necord-registry.js
CHANGED
|
@@ -21,12 +21,16 @@ let NecordRegistry = NecordRegistry_1 = class NecordRegistry {
|
|
|
21
21
|
this.messageComponents = new discord_js_1.Collection();
|
|
22
22
|
this.applicationCommands = new discord_js_1.Collection();
|
|
23
23
|
this.applicationCommandsData = [];
|
|
24
|
+
this.modals = new discord_js_1.Collection();
|
|
24
25
|
}
|
|
25
26
|
registerListeners(listeners) {
|
|
26
27
|
listeners.forEach(listener => {
|
|
27
28
|
this.client[listener.type](listener.event, (...args) => listener.metadata.execute(args, null, { type: context_1.NecordInfoType.LISTENER }));
|
|
28
29
|
});
|
|
29
30
|
}
|
|
31
|
+
addModals(modals) {
|
|
32
|
+
modals.forEach(modal => this.modals.set(modal.customId, modal));
|
|
33
|
+
}
|
|
30
34
|
addTextCommands(textCommands) {
|
|
31
35
|
textCommands.forEach(command => this.textCommands.set(command.name, command));
|
|
32
36
|
}
|
|
@@ -70,6 +74,9 @@ let NecordRegistry = NecordRegistry_1 = class NecordRegistry {
|
|
|
70
74
|
getSelectMenu(customId) {
|
|
71
75
|
return this.getMessageComponent('SELECT_MENU', customId);
|
|
72
76
|
}
|
|
77
|
+
getModal(customId) {
|
|
78
|
+
return this.modals.get(customId);
|
|
79
|
+
}
|
|
73
80
|
};
|
|
74
81
|
NecordRegistry.GENERATE_KEY = (...args) => args.map(String).join(':');
|
|
75
82
|
NecordRegistry = NecordRegistry_1 = __decorate([
|
|
@@ -4,7 +4,8 @@ export declare const TEXT_COMMAND_METADATA = "necord:text_command_meta";
|
|
|
4
4
|
export declare const APPLICATION_COMMAND_METADATA = "necord:application_command_meta";
|
|
5
5
|
export declare const MESSAGE_COMPONENT_METADATA = "necord:message_component_meta";
|
|
6
6
|
export declare const LISTENERS_METADATA = "necord:listeners_meta";
|
|
7
|
-
export declare const AUTOCOMPLETE_METADATA = "necord:
|
|
7
|
+
export declare const AUTOCOMPLETE_METADATA = "necord:autocomplete_meta";
|
|
8
|
+
export declare const MODALS_METADATA = "necord:modals_meta";
|
|
8
9
|
export declare const GROUP_METADATA = "necord:group_meta";
|
|
9
10
|
export declare const OPTIONS_METADATA = "necord:options_meta";
|
|
10
11
|
export declare const GUILDS_METADATA = "necord:guilds_meta";
|
package/dist/necord.constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GUILDS_METADATA = exports.OPTIONS_METADATA = exports.GROUP_METADATA = exports.AUTOCOMPLETE_METADATA = exports.LISTENERS_METADATA = exports.MESSAGE_COMPONENT_METADATA = exports.APPLICATION_COMMAND_METADATA = exports.TEXT_COMMAND_METADATA = exports.PARAM_ARGS_METADATA = exports.NECORD_MODULE_OPTIONS = void 0;
|
|
3
|
+
exports.GUILDS_METADATA = exports.OPTIONS_METADATA = exports.GROUP_METADATA = exports.MODALS_METADATA = exports.AUTOCOMPLETE_METADATA = exports.LISTENERS_METADATA = exports.MESSAGE_COMPONENT_METADATA = exports.APPLICATION_COMMAND_METADATA = exports.TEXT_COMMAND_METADATA = exports.PARAM_ARGS_METADATA = exports.NECORD_MODULE_OPTIONS = void 0;
|
|
4
4
|
const constants_1 = require("@nestjs/common/constants");
|
|
5
5
|
exports.NECORD_MODULE_OPTIONS = 'necord:module_options';
|
|
6
6
|
exports.PARAM_ARGS_METADATA = constants_1.ROUTE_ARGS_METADATA;
|
|
@@ -8,7 +8,8 @@ exports.TEXT_COMMAND_METADATA = 'necord:text_command_meta';
|
|
|
8
8
|
exports.APPLICATION_COMMAND_METADATA = 'necord:application_command_meta';
|
|
9
9
|
exports.MESSAGE_COMPONENT_METADATA = 'necord:message_component_meta';
|
|
10
10
|
exports.LISTENERS_METADATA = 'necord:listeners_meta';
|
|
11
|
-
exports.AUTOCOMPLETE_METADATA = 'necord:
|
|
11
|
+
exports.AUTOCOMPLETE_METADATA = 'necord:autocomplete_meta';
|
|
12
|
+
exports.MODALS_METADATA = 'necord:modals_meta';
|
|
12
13
|
exports.GROUP_METADATA = 'necord:group_meta';
|
|
13
14
|
exports.OPTIONS_METADATA = 'necord:options_meta';
|
|
14
15
|
exports.GUILDS_METADATA = 'necord:guilds_meta';
|
package/dist/necord.module.js
CHANGED
|
@@ -40,11 +40,12 @@ let NecordModule = NecordModule_1 = class NecordModule {
|
|
|
40
40
|
}
|
|
41
41
|
onApplicationBootstrap() {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
const { listeners, components, appCommands, textCommands } = this.explorer.explore();
|
|
43
|
+
const { listeners, components, appCommands, textCommands, modals } = this.explorer.explore();
|
|
44
44
|
this.registry.registerListeners(listeners);
|
|
45
45
|
this.registry.addTextCommands(textCommands);
|
|
46
46
|
this.registry.addMessageComponents(components);
|
|
47
47
|
this.registry.addApplicationCommands(appCommands);
|
|
48
|
+
this.registry.addModals(modals);
|
|
48
49
|
return this.client.login(this.options.token);
|
|
49
50
|
});
|
|
50
51
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "necord",
|
|
3
3
|
"description": "A module for creating Discord bots using NestJS, based on Discord.js.",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.3.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rimraf -rf dist && tsc -p tsconfig.json",
|
|
7
7
|
"prepublish:npm": "npm run build",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@types/node": "17.0.17",
|
|
54
54
|
"@typescript-eslint/eslint-plugin": "5.11.0",
|
|
55
55
|
"@typescript-eslint/parser": "5.11.0",
|
|
56
|
-
"discord.js": "13.
|
|
56
|
+
"discord.js": "13.7.0",
|
|
57
57
|
"eslint": "8.8.0",
|
|
58
58
|
"eslint-config-prettier": "8.3.0",
|
|
59
59
|
"eslint-plugin-prettier": "4.0.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@nestjs/common": "^8.0.0",
|
|
71
71
|
"@nestjs/core": "^8.0.0",
|
|
72
|
-
"discord.js": "^13.
|
|
72
|
+
"discord.js": "^13.7.0",
|
|
73
73
|
"reflect-metadata": "^0.1.13",
|
|
74
74
|
"rxjs": "^7.2.0"
|
|
75
75
|
},
|