necord 5.8.7 → 5.9.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/commands.service.d.ts +2 -2
- package/dist/commands/commands.service.js +3 -1
- package/dist/commands/context-menus/context-menus.service.d.ts +2 -2
- package/dist/commands/context-menus/context-menus.service.js +5 -3
- package/dist/commands/slash-commands/slash-command.discovery.d.ts +1 -1
- package/dist/commands/slash-commands/slash-command.discovery.js +3 -2
- package/dist/commands/slash-commands/slash-commands.service.d.ts +3 -3
- package/dist/commands/slash-commands/slash-commands.service.js +11 -8
- package/dist/listeners/listener.interface.d.ts +13 -1
- package/dist/listeners/listeners.service.d.ts +2 -2
- package/dist/listeners/listeners.service.js +18 -6
- package/dist/message-components/message-components.service.d.ts +1 -0
- package/dist/message-components/message-components.service.js +11 -7
- package/dist/modals/modals.service.d.ts +1 -0
- package/dist/modals/modals.service.js +11 -7
- package/dist/text-commands/text-commands.service.d.ts +1 -0
- package/dist/text-commands/text-commands.service.js +5 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OnApplicationBootstrap, OnModuleInit } from '@nestjs/common';
|
|
2
|
-
import { Client } from 'discord.js';
|
|
2
|
+
import { Client, Collection } from 'discord.js';
|
|
3
3
|
import { NecordModuleOptions } from '../necord-options.interface';
|
|
4
4
|
import { ContextMenusService } from './context-menus';
|
|
5
5
|
import { CommandDiscovery } from './command.discovery';
|
|
@@ -15,7 +15,7 @@ export declare class CommandsService implements OnModuleInit, OnApplicationBoots
|
|
|
15
15
|
onModuleInit(): Client<boolean>;
|
|
16
16
|
onApplicationBootstrap(): void;
|
|
17
17
|
register(): Promise<void>;
|
|
18
|
-
registerInGuild(guildId: string): Promise<
|
|
18
|
+
registerInGuild(guildId: string): Promise<Collection<string, import("discord.js").ApplicationCommand<{}>>>;
|
|
19
19
|
getCommands(): CommandDiscovery[];
|
|
20
20
|
getCommandByName(name: string): CommandDiscovery;
|
|
21
21
|
getGlobalCommands(): CommandDiscovery[];
|
|
@@ -35,7 +35,9 @@ let CommandsService = exports.CommandsService = CommandsService_1 = class Comman
|
|
|
35
35
|
this.contextMenusService = contextMenusService;
|
|
36
36
|
this.slashCommandsService = slashCommandsService;
|
|
37
37
|
this.logger = new common_1.Logger(CommandsService_1.name);
|
|
38
|
-
this.applicationCommands = new
|
|
38
|
+
this.applicationCommands = new discord_js_1.Collection([
|
|
39
|
+
[undefined, []]
|
|
40
|
+
]);
|
|
39
41
|
}
|
|
40
42
|
onModuleInit() {
|
|
41
43
|
if (this.options.skipRegistration) {
|
|
@@ -2,7 +2,6 @@ import { Client } from 'discord.js';
|
|
|
2
2
|
import { OnApplicationBootstrap, OnModuleInit } from '@nestjs/common';
|
|
3
3
|
import { ContextMenuDiscovery, ContextMenuMeta } from './context-menu.discovery';
|
|
4
4
|
import { ExplorerService } from '../../necord-explorer.service';
|
|
5
|
-
import { CommandDiscovery } from '../command.discovery';
|
|
6
5
|
export declare class ContextMenusService implements OnModuleInit, OnApplicationBootstrap {
|
|
7
6
|
private readonly client;
|
|
8
7
|
private readonly explorerService;
|
|
@@ -11,8 +10,9 @@ export declare class ContextMenusService implements OnModuleInit, OnApplicationB
|
|
|
11
10
|
constructor(client: Client, explorerService: ExplorerService<ContextMenuDiscovery>);
|
|
12
11
|
onModuleInit(): void;
|
|
13
12
|
onApplicationBootstrap(): Client<boolean>;
|
|
14
|
-
getCommands():
|
|
13
|
+
getCommands(): ContextMenuDiscovery[];
|
|
15
14
|
add(contextMenu: ContextMenuDiscovery): void;
|
|
15
|
+
get(type: ContextMenuMeta['type'], name: ContextMenuMeta['name']): ContextMenuDiscovery;
|
|
16
16
|
remove(type: ContextMenuMeta['type'], name: ContextMenuMeta['name']): boolean;
|
|
17
17
|
private getId;
|
|
18
18
|
}
|
|
@@ -20,7 +20,7 @@ let ContextMenusService = exports.ContextMenusService = ContextMenusService_1 =
|
|
|
20
20
|
this.client = client;
|
|
21
21
|
this.explorerService = explorerService;
|
|
22
22
|
this.logger = new common_1.Logger(ContextMenusService_1.name);
|
|
23
|
-
this.contextMenus = new
|
|
23
|
+
this.contextMenus = new discord_js_1.Collection();
|
|
24
24
|
}
|
|
25
25
|
onModuleInit() {
|
|
26
26
|
return this.explorerService
|
|
@@ -32,8 +32,7 @@ let ContextMenusService = exports.ContextMenusService = ContextMenusService_1 =
|
|
|
32
32
|
var _a;
|
|
33
33
|
if (!interaction.isContextMenuCommand())
|
|
34
34
|
return;
|
|
35
|
-
return (_a = this.
|
|
36
|
-
.get(this.getId(interaction.commandType, interaction.commandName))) === null || _a === void 0 ? void 0 : _a.execute(interaction);
|
|
35
|
+
return (_a = this.get(interaction.commandType, interaction.commandName)) === null || _a === void 0 ? void 0 : _a.execute(interaction);
|
|
37
36
|
});
|
|
38
37
|
}
|
|
39
38
|
getCommands() {
|
|
@@ -46,6 +45,9 @@ let ContextMenusService = exports.ContextMenusService = ContextMenusService_1 =
|
|
|
46
45
|
}
|
|
47
46
|
this.contextMenus.set(id, contextMenu);
|
|
48
47
|
}
|
|
48
|
+
get(type, name) {
|
|
49
|
+
return this.contextMenus.get(this.getId(type, name));
|
|
50
|
+
}
|
|
49
51
|
remove(type, name) {
|
|
50
52
|
return this.contextMenus.delete(this.getId(type, name));
|
|
51
53
|
}
|
|
@@ -11,7 +11,7 @@ export interface OptionMeta extends APIApplicationCommandOptionBase<any> {
|
|
|
11
11
|
export declare class SlashCommandDiscovery extends CommandDiscovery<SlashCommandMeta> {
|
|
12
12
|
private readonly subcommands;
|
|
13
13
|
getDescription(): string;
|
|
14
|
-
|
|
14
|
+
setSubcommand(command: SlashCommandDiscovery): void;
|
|
15
15
|
getRawOptions(): Record<string, OptionMeta>;
|
|
16
16
|
getOptions(): any;
|
|
17
17
|
execute(interaction: ChatInputCommandInteraction | AutocompleteInteraction, depth?: number): any;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SlashCommandDiscovery = void 0;
|
|
4
|
+
const discord_js_1 = require("discord.js");
|
|
4
5
|
const necord_constants_1 = require("../../necord.constants");
|
|
5
6
|
const command_discovery_1 = require("../command.discovery");
|
|
6
7
|
class SlashCommandDiscovery extends command_discovery_1.CommandDiscovery {
|
|
7
8
|
constructor() {
|
|
8
9
|
super(...arguments);
|
|
9
|
-
this.subcommands = new
|
|
10
|
+
this.subcommands = new discord_js_1.Collection();
|
|
10
11
|
}
|
|
11
12
|
getDescription() {
|
|
12
13
|
return this.meta.description;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
+
setSubcommand(command) {
|
|
15
16
|
this.subcommands.set(command.getName(), command);
|
|
16
17
|
}
|
|
17
18
|
getRawOptions() {
|
|
@@ -2,7 +2,6 @@ import { OnApplicationBootstrap, OnModuleInit } from '@nestjs/common';
|
|
|
2
2
|
import { SlashCommandDiscovery } from './slash-command.discovery';
|
|
3
3
|
import { Client } from 'discord.js';
|
|
4
4
|
import { ExplorerService } from '../../necord-explorer.service';
|
|
5
|
-
import { CommandDiscovery } from '../command.discovery';
|
|
6
5
|
import { Reflector } from '@nestjs/core';
|
|
7
6
|
export declare class SlashCommandsService implements OnModuleInit, OnApplicationBootstrap {
|
|
8
7
|
private readonly client;
|
|
@@ -13,8 +12,9 @@ export declare class SlashCommandsService implements OnModuleInit, OnApplication
|
|
|
13
12
|
constructor(client: Client, explorerService: ExplorerService<SlashCommandDiscovery>, reflector: Reflector);
|
|
14
13
|
onModuleInit(): Promise<void>;
|
|
15
14
|
onApplicationBootstrap(): Client<boolean>;
|
|
16
|
-
getCommands():
|
|
15
|
+
getCommands(): SlashCommandDiscovery[];
|
|
17
16
|
add(command: SlashCommandDiscovery): void;
|
|
18
|
-
|
|
17
|
+
get(commandName: string): SlashCommandDiscovery;
|
|
19
18
|
remove(commandName: string): boolean;
|
|
19
|
+
private addSubCommand;
|
|
20
20
|
}
|
|
@@ -31,7 +31,7 @@ let SlashCommandsService = exports.SlashCommandsService = SlashCommandsService_1
|
|
|
31
31
|
this.explorerService = explorerService;
|
|
32
32
|
this.reflector = reflector;
|
|
33
33
|
this.logger = new common_1.Logger(SlashCommandsService_1.name);
|
|
34
|
-
this.slashCommands = new
|
|
34
|
+
this.slashCommands = new discord_js_1.Collection();
|
|
35
35
|
}
|
|
36
36
|
onModuleInit() {
|
|
37
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -47,7 +47,7 @@ let SlashCommandsService = exports.SlashCommandsService = SlashCommandsService_1
|
|
|
47
47
|
if (!i.isChatInputCommand() &&
|
|
48
48
|
i.type !== discord_js_1.InteractionType.ApplicationCommandAutocomplete)
|
|
49
49
|
return;
|
|
50
|
-
return (_a = this.
|
|
50
|
+
return (_a = this.get(i.commandName)) === null || _a === void 0 ? void 0 : _a.execute(i);
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
getCommands() {
|
|
@@ -59,6 +59,12 @@ let SlashCommandsService = exports.SlashCommandsService = SlashCommandsService_1
|
|
|
59
59
|
}
|
|
60
60
|
this.slashCommands.set(command.getName(), command);
|
|
61
61
|
}
|
|
62
|
+
get(commandName) {
|
|
63
|
+
return this.slashCommands.get(commandName);
|
|
64
|
+
}
|
|
65
|
+
remove(commandName) {
|
|
66
|
+
return this.slashCommands.delete(commandName);
|
|
67
|
+
}
|
|
62
68
|
addSubCommand(subCommand) {
|
|
63
69
|
const rootCommand = this.reflector.get(necord_constants_1.SLASH_COMMAND_METADATA, subCommand.getClass());
|
|
64
70
|
const subCommandGroup = this.reflector.get(necord_constants_1.SUBCOMMAND_GROUP_METADATA, subCommand.getClass());
|
|
@@ -66,19 +72,16 @@ let SlashCommandsService = exports.SlashCommandsService = SlashCommandsService_1
|
|
|
66
72
|
throw new ReferenceError(`can't register subcommand "${subCommand.getName()}" w/o root command`);
|
|
67
73
|
}
|
|
68
74
|
if (subCommandGroup) {
|
|
69
|
-
subCommandGroup.
|
|
70
|
-
rootCommand.
|
|
75
|
+
subCommandGroup.setSubcommand(subCommand);
|
|
76
|
+
rootCommand.setSubcommand(subCommandGroup);
|
|
71
77
|
}
|
|
72
78
|
else {
|
|
73
|
-
rootCommand.
|
|
79
|
+
rootCommand.setSubcommand(subCommand);
|
|
74
80
|
}
|
|
75
81
|
if (!this.slashCommands.has(rootCommand.getName())) {
|
|
76
82
|
this.slashCommands.set(rootCommand.getName(), rootCommand);
|
|
77
83
|
}
|
|
78
84
|
}
|
|
79
|
-
remove(commandName) {
|
|
80
|
-
return this.slashCommands.delete(commandName);
|
|
81
|
-
}
|
|
82
85
|
};
|
|
83
86
|
exports.SlashCommandsService = SlashCommandsService = SlashCommandsService_1 = __decorate([
|
|
84
87
|
(0, common_1.Injectable)(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClientEvents, DMChannel, Guild, GuildAuditLogsEntry, GuildFeature, GuildMember, GuildPremiumTier, Message, NonThreadGuildBasedChannel, PartialMessage, PermissionOverwriteManager, PermissionsBitField, PresenceStatus, Role, ThreadChannel, User, UserFlagsBitField, VoiceBasedChannel, VoiceChannel } from 'discord.js';
|
|
1
|
+
import { AuditLogEvent, ClientEvents, DMChannel, Guild, GuildAuditLogsEntry, GuildFeature, GuildMember, GuildPremiumTier, Message, NonThreadGuildBasedChannel, PartialMessage, PermissionOverwriteManager, PermissionsBitField, PresenceStatus, Role, ThreadChannel, User, UserFlagsBitField, VoiceBasedChannel, VoiceChannel } from 'discord.js';
|
|
2
2
|
export interface NecordEvents extends ClientEvents {
|
|
3
3
|
guildChannelPermissionsUpdate: [
|
|
4
4
|
channel: DMChannel | NonThreadGuildBasedChannel,
|
|
@@ -90,4 +90,16 @@ export interface NecordEvents extends ClientEvents {
|
|
|
90
90
|
guildAuditLogEntryAdd: [auditLogEntry: GuildAuditLogsEntry, guild: Guild];
|
|
91
91
|
guildAuditLogEntryUpdate: [auditLogEntry: GuildAuditLogsEntry, guild: Guild];
|
|
92
92
|
guildAuditLogEntryDelete: [auditLogEntry: GuildAuditLogsEntry, guild: Guild];
|
|
93
|
+
guildAuditLogEntryWebhookCreate: [
|
|
94
|
+
auditLogEntry: GuildAuditLogsEntry<AuditLogEvent.WebhookCreate>,
|
|
95
|
+
guild: Guild
|
|
96
|
+
];
|
|
97
|
+
guildAuditLogEntryWebhookUpdate: [
|
|
98
|
+
auditLogEntry: GuildAuditLogsEntry<AuditLogEvent.WebhookUpdate>,
|
|
99
|
+
guild: Guild
|
|
100
|
+
];
|
|
101
|
+
guildAuditLogEntryWebhookDelete: [
|
|
102
|
+
auditLogEntry: GuildAuditLogsEntry<AuditLogEvent.WebhookDelete>,
|
|
103
|
+
guild: Guild
|
|
104
|
+
];
|
|
93
105
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OnApplicationBootstrap, OnModuleInit } from '@nestjs/common';
|
|
2
|
-
import { ListenerDiscovery } from './listener.discovery';
|
|
3
1
|
import { Client } from 'discord.js';
|
|
2
|
+
import { OnApplicationBootstrap, OnModuleInit } from '@nestjs/common';
|
|
4
3
|
import { ExplorerService } from '../necord-explorer.service';
|
|
4
|
+
import { ListenerDiscovery } from './listener.discovery';
|
|
5
5
|
export declare class ListenersService implements OnModuleInit, OnApplicationBootstrap {
|
|
6
6
|
private readonly client;
|
|
7
7
|
private readonly explorerService;
|
|
@@ -10,10 +10,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ListenersService = void 0;
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
13
|
const discord_js_1 = require("discord.js");
|
|
15
|
-
const
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
16
15
|
const necord_explorer_service_1 = require("../necord-explorer.service");
|
|
16
|
+
const necord_constants_1 = require("../necord.constants");
|
|
17
17
|
let ListenersService = exports.ListenersService = class ListenersService {
|
|
18
18
|
constructor(client, explorerService) {
|
|
19
19
|
this.client = client;
|
|
@@ -230,17 +230,29 @@ let ListenersService = exports.ListenersService = class ListenersService {
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
onGuildAuditLogEntryCreate([auditLogEntry, guild]) {
|
|
233
|
-
const { actionType } = auditLogEntry;
|
|
233
|
+
const { actionType, targetType } = auditLogEntry;
|
|
234
234
|
switch (actionType) {
|
|
235
|
-
case 'Create':
|
|
235
|
+
case 'Create': {
|
|
236
236
|
this.emit('guildAuditLogEntryAdd', auditLogEntry, guild);
|
|
237
|
+
if (targetType === 'Webhook') {
|
|
238
|
+
this.emit('guildAuditLogEntryWebhookCreate', auditLogEntry, guild);
|
|
239
|
+
}
|
|
237
240
|
break;
|
|
238
|
-
|
|
241
|
+
}
|
|
242
|
+
case 'Update': {
|
|
239
243
|
this.emit('guildAuditLogEntryUpdate', auditLogEntry, guild);
|
|
244
|
+
if (targetType === 'Webhook') {
|
|
245
|
+
this.emit('guildAuditLogEntryWebhookUpdate', auditLogEntry, guild);
|
|
246
|
+
}
|
|
240
247
|
break;
|
|
241
|
-
|
|
248
|
+
}
|
|
249
|
+
case 'Delete': {
|
|
242
250
|
this.emit('guildAuditLogEntryDelete', auditLogEntry, guild);
|
|
251
|
+
if (targetType === 'Webhook') {
|
|
252
|
+
this.emit('guildAuditLogEntryWebhookDelete', auditLogEntry, guild);
|
|
253
|
+
}
|
|
243
254
|
break;
|
|
255
|
+
}
|
|
244
256
|
default:
|
|
245
257
|
break;
|
|
246
258
|
}
|
|
@@ -12,5 +12,6 @@ export declare class MessageComponentsService implements OnModuleInit, OnApplica
|
|
|
12
12
|
onApplicationBootstrap(): Client<boolean>;
|
|
13
13
|
private componentName;
|
|
14
14
|
add(component: MessageComponentDiscovery): void;
|
|
15
|
+
get(type: MessageComponentMeta['type'], customId: MessageComponentMeta['customId']): MessageComponentDiscovery;
|
|
15
16
|
remove(type: MessageComponentMeta['type'], customId: MessageComponentMeta['customId']): void;
|
|
16
17
|
}
|
|
@@ -20,7 +20,7 @@ let MessageComponentsService = exports.MessageComponentsService = MessageCompone
|
|
|
20
20
|
this.client = client;
|
|
21
21
|
this.explorerService = explorerService;
|
|
22
22
|
this.logger = new common_1.Logger(MessageComponentsService_1.name);
|
|
23
|
-
this.components = new
|
|
23
|
+
this.components = new discord_js_1.Collection();
|
|
24
24
|
}
|
|
25
25
|
onModuleInit() {
|
|
26
26
|
return this.explorerService
|
|
@@ -29,14 +29,10 @@ let MessageComponentsService = exports.MessageComponentsService = MessageCompone
|
|
|
29
29
|
}
|
|
30
30
|
onApplicationBootstrap() {
|
|
31
31
|
return this.client.on('interactionCreate', interaction => {
|
|
32
|
+
var _a;
|
|
32
33
|
if (interaction.type !== discord_js_1.InteractionType.MessageComponent)
|
|
33
34
|
return;
|
|
34
|
-
|
|
35
|
-
for (const component of this.components.values()) {
|
|
36
|
-
if (component.matcher(name)) {
|
|
37
|
-
return component.execute(interaction);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
35
|
+
return (_a = this.get(interaction.componentType, interaction.customId)) === null || _a === void 0 ? void 0 : _a.execute(interaction);
|
|
40
36
|
});
|
|
41
37
|
}
|
|
42
38
|
componentName(type, customId) {
|
|
@@ -49,6 +45,14 @@ let MessageComponentsService = exports.MessageComponentsService = MessageCompone
|
|
|
49
45
|
}
|
|
50
46
|
this.components.set(name, component);
|
|
51
47
|
}
|
|
48
|
+
get(type, customId) {
|
|
49
|
+
for (const component of this.components.values()) {
|
|
50
|
+
if (component.matcher(this.componentName(type, customId))) {
|
|
51
|
+
return component;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
52
56
|
remove(type, customId) {
|
|
53
57
|
this.components.delete(this.componentName(type, customId));
|
|
54
58
|
}
|
|
@@ -11,5 +11,6 @@ export declare class ModalsService implements OnModuleInit, OnApplicationBootstr
|
|
|
11
11
|
onModuleInit(): void;
|
|
12
12
|
onApplicationBootstrap(): Client<boolean>;
|
|
13
13
|
add(modal: ModalDiscovery): void;
|
|
14
|
+
get(customId: string): ModalDiscovery;
|
|
14
15
|
remove(customId: string): void;
|
|
15
16
|
}
|
|
@@ -20,21 +20,17 @@ let ModalsService = exports.ModalsService = ModalsService_1 = class ModalsServic
|
|
|
20
20
|
this.client = client;
|
|
21
21
|
this.explorerService = explorerService;
|
|
22
22
|
this.logger = new common_1.Logger(ModalsService_1.name);
|
|
23
|
-
this.modals = new
|
|
23
|
+
this.modals = new discord_js_1.Collection();
|
|
24
24
|
}
|
|
25
25
|
onModuleInit() {
|
|
26
26
|
return this.explorerService.explore(necord_constants_1.MODAL_METADATA).forEach(modal => this.add(modal));
|
|
27
27
|
}
|
|
28
28
|
onApplicationBootstrap() {
|
|
29
29
|
return this.client.on('interactionCreate', interaction => {
|
|
30
|
+
var _a;
|
|
30
31
|
if (interaction.type !== discord_js_1.InteractionType.ModalSubmit)
|
|
31
32
|
return;
|
|
32
|
-
|
|
33
|
-
for (const modal of this.modals.values()) {
|
|
34
|
-
if (modal.matcher(name)) {
|
|
35
|
-
return modal.execute(interaction);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
33
|
+
return (_a = this.get(interaction.customId)) === null || _a === void 0 ? void 0 : _a.execute(interaction);
|
|
38
34
|
});
|
|
39
35
|
}
|
|
40
36
|
add(modal) {
|
|
@@ -44,6 +40,14 @@ let ModalsService = exports.ModalsService = ModalsService_1 = class ModalsServic
|
|
|
44
40
|
}
|
|
45
41
|
this.modals.set(id, modal);
|
|
46
42
|
}
|
|
43
|
+
get(customId) {
|
|
44
|
+
for (const modal of this.modals.values()) {
|
|
45
|
+
if (modal.matcher(customId)) {
|
|
46
|
+
return modal;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
47
51
|
remove(customId) {
|
|
48
52
|
this.modals.delete(customId);
|
|
49
53
|
}
|
|
@@ -13,5 +13,6 @@ export declare class TextCommandsService implements OnModuleInit, OnApplicationB
|
|
|
13
13
|
onModuleInit(): void;
|
|
14
14
|
onApplicationBootstrap(): Client<boolean>;
|
|
15
15
|
add(textCommand: TextCommandDiscovery): void;
|
|
16
|
+
get(name: string): TextCommandDiscovery;
|
|
16
17
|
remove(name: string): void;
|
|
17
18
|
}
|
|
@@ -33,7 +33,7 @@ let TextCommandsService = exports.TextCommandsService = TextCommandsService_1 =
|
|
|
33
33
|
this.client = client;
|
|
34
34
|
this.explorerService = explorerService;
|
|
35
35
|
this.logger = new common_1.Logger(TextCommandsService_1.name);
|
|
36
|
-
this.textCommands = new
|
|
36
|
+
this.textCommands = new discord_js_1.Collection();
|
|
37
37
|
}
|
|
38
38
|
onModuleInit() {
|
|
39
39
|
return this.explorerService
|
|
@@ -55,7 +55,7 @@ let TextCommandsService = exports.TextCommandsService = TextCommandsService_1 =
|
|
|
55
55
|
const cmd = args.shift();
|
|
56
56
|
if (!cmd)
|
|
57
57
|
return;
|
|
58
|
-
return (_c = this.
|
|
58
|
+
return (_c = this.get(cmd)) === null || _c === void 0 ? void 0 : _c.execute([message]);
|
|
59
59
|
}));
|
|
60
60
|
}
|
|
61
61
|
add(textCommand) {
|
|
@@ -65,6 +65,9 @@ let TextCommandsService = exports.TextCommandsService = TextCommandsService_1 =
|
|
|
65
65
|
}
|
|
66
66
|
this.textCommands.set(name, textCommand);
|
|
67
67
|
}
|
|
68
|
+
get(name) {
|
|
69
|
+
return this.textCommands.get(name);
|
|
70
|
+
}
|
|
68
71
|
remove(name) {
|
|
69
72
|
this.textCommands.delete(name);
|
|
70
73
|
}
|
package/package.json
CHANGED