@guardbot/framework 1.0.0 → 1.1.1
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/build/index.d.mts +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +7 -7
- package/build/index.mjs +7 -7
- package/package.json +1 -1
package/build/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as discord_js from 'discord.js';
|
|
2
2
|
import { Client, PermissionResolvable, InteractionContextType, ApplicationIntegrationType, LocalizationMap, ApplicationCommandOptionData, ChatInputCommandInteraction, AutocompleteInteraction, Message, ContextMenuCommandInteraction, CommandInteraction, PermissionsString, Interaction, Collection, ClientEvents, ModalSubmitInteraction, ClientOptions, MessageCollectorOptions, InteractionCollectorOptions } from 'discord.js';
|
|
3
|
-
export { SlashCommandAttachmentOption as AttachmentOption, SlashCommandBooleanOption as BooleanOption, SlashCommandChannelOption as ChannelOption, SlashCommandIntegerOption as IntegerOption, SlashCommandMentionableOption as MentionableOption, SlashCommandNumberOption as NumberOption, SlashCommandRoleOption as RoleOption,
|
|
3
|
+
export { SlashCommandAttachmentOption as AttachmentOption, SlashCommandBooleanOption as BooleanOption, SlashCommandChannelOption as ChannelOption, SlashCommandIntegerOption as IntegerOption, SlashCommandMentionableOption as MentionableOption, SlashCommandNumberOption as NumberOption, SlashCommandRoleOption as RoleOption, SlashCommandStringOption as StringOption, SlashCommandSubcommandBuilder as SubcommandBuilder, SlashCommandSubcommandGroupBuilder as SubcommandGroupBuilder, SlashCommandUserOption as UserOption } from 'discord.js';
|
|
4
4
|
import EventEmitter from 'events';
|
|
5
5
|
|
|
6
6
|
declare class FrameworkClient<Ready extends boolean = boolean> extends Client<Ready> {
|
package/build/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as discord_js from 'discord.js';
|
|
2
2
|
import { Client, PermissionResolvable, InteractionContextType, ApplicationIntegrationType, LocalizationMap, ApplicationCommandOptionData, ChatInputCommandInteraction, AutocompleteInteraction, Message, ContextMenuCommandInteraction, CommandInteraction, PermissionsString, Interaction, Collection, ClientEvents, ModalSubmitInteraction, ClientOptions, MessageCollectorOptions, InteractionCollectorOptions } from 'discord.js';
|
|
3
|
-
export { SlashCommandAttachmentOption as AttachmentOption, SlashCommandBooleanOption as BooleanOption, SlashCommandChannelOption as ChannelOption, SlashCommandIntegerOption as IntegerOption, SlashCommandMentionableOption as MentionableOption, SlashCommandNumberOption as NumberOption, SlashCommandRoleOption as RoleOption,
|
|
3
|
+
export { SlashCommandAttachmentOption as AttachmentOption, SlashCommandBooleanOption as BooleanOption, SlashCommandChannelOption as ChannelOption, SlashCommandIntegerOption as IntegerOption, SlashCommandMentionableOption as MentionableOption, SlashCommandNumberOption as NumberOption, SlashCommandRoleOption as RoleOption, SlashCommandStringOption as StringOption, SlashCommandSubcommandBuilder as SubcommandBuilder, SlashCommandSubcommandGroupBuilder as SubcommandGroupBuilder, SlashCommandUserOption as UserOption } from 'discord.js';
|
|
4
4
|
import EventEmitter from 'events';
|
|
5
5
|
|
|
6
6
|
declare class FrameworkClient<Ready extends boolean = boolean> extends Client<Ready> {
|
package/build/index.js
CHANGED
|
@@ -43,10 +43,10 @@ __export(index_exports, {
|
|
|
43
43
|
NumberOption: () => import_discord7.SlashCommandNumberOption,
|
|
44
44
|
RoleOption: () => import_discord7.SlashCommandRoleOption,
|
|
45
45
|
SlashCommand: () => SlashCommand,
|
|
46
|
-
SlashCommandOptionsBuilder: () => import_discord7.SlashCommandOptionsOnlyBuilder,
|
|
47
46
|
StringOption: () => import_discord7.SlashCommandStringOption,
|
|
48
47
|
SubcommandBuilder: () => import_discord7.SlashCommandSubcommandBuilder,
|
|
49
|
-
SubcommandGroupBuilder: () => import_discord7.SlashCommandSubcommandGroupBuilder
|
|
48
|
+
SubcommandGroupBuilder: () => import_discord7.SlashCommandSubcommandGroupBuilder,
|
|
49
|
+
UserOption: () => import_discord7.SlashCommandUserOption
|
|
50
50
|
});
|
|
51
51
|
module.exports = __toCommonJS(index_exports);
|
|
52
52
|
|
|
@@ -263,7 +263,7 @@ var AutocompleteModule = class extends import_events.default {
|
|
|
263
263
|
}
|
|
264
264
|
async load(filepath, reload = false) {
|
|
265
265
|
const completerModule = await import((0, import_node_url.pathToFileURL)(filepath).href);
|
|
266
|
-
const completer = completerModule.autocomplete ?? completerModule.default ?? completerModule;
|
|
266
|
+
const completer = completerModule.autocomplete ?? completerModule.default?.default ?? completerModule.default ?? completerModule;
|
|
267
267
|
if (typeof completer !== "object" || !completer.name || completer.disabled) return false;
|
|
268
268
|
if (!reload && this.client.autocomplete.has(completer.id)) throw new FrameworkError("ComponentAlreadyLoaded", "autocomplete", completer.id);
|
|
269
269
|
completer.filepath = filepath;
|
|
@@ -334,7 +334,7 @@ var ListenerModule = class {
|
|
|
334
334
|
}
|
|
335
335
|
async load(filepath, reload = false) {
|
|
336
336
|
const listenerModule = await import((0, import_node_url2.pathToFileURL)(filepath).href);
|
|
337
|
-
const listener = listenerModule.listener ?? listenerModule.default ?? listenerModule;
|
|
337
|
+
const listener = listenerModule.listener ?? listenerModule.default?.default ?? listenerModule.default ?? listenerModule;
|
|
338
338
|
if (typeof listener !== "object" || !listener.name || listener.disabled) return false;
|
|
339
339
|
if (!reload && this.client.events.has(listener.id)) throw new FrameworkError("ComponentAlreadyLoaded", "listener", listener.id);
|
|
340
340
|
listener.filepath = filepath;
|
|
@@ -606,9 +606,9 @@ var FrameworkClient = class extends import_discord5.Client {
|
|
|
606
606
|
});
|
|
607
607
|
}
|
|
608
608
|
async start(token) {
|
|
609
|
+
await this.listenerModule.loadAll();
|
|
609
610
|
await this.autocompleteModule.loadAll();
|
|
610
611
|
await this.commandsModule.loadAll();
|
|
611
|
-
await this.listenerModule.loadAll();
|
|
612
612
|
await this.login(token);
|
|
613
613
|
}
|
|
614
614
|
};
|
|
@@ -692,8 +692,8 @@ var import_discord7 = require("discord.js");
|
|
|
692
692
|
NumberOption,
|
|
693
693
|
RoleOption,
|
|
694
694
|
SlashCommand,
|
|
695
|
-
SlashCommandOptionsBuilder,
|
|
696
695
|
StringOption,
|
|
697
696
|
SubcommandBuilder,
|
|
698
|
-
SubcommandGroupBuilder
|
|
697
|
+
SubcommandGroupBuilder,
|
|
698
|
+
UserOption
|
|
699
699
|
});
|
package/build/index.mjs
CHANGED
|
@@ -218,7 +218,7 @@ var AutocompleteModule = class extends EventEmitter {
|
|
|
218
218
|
}
|
|
219
219
|
async load(filepath, reload = false) {
|
|
220
220
|
const completerModule = await import(pathToFileURL(filepath).href);
|
|
221
|
-
const completer = completerModule.autocomplete ?? completerModule.default ?? completerModule;
|
|
221
|
+
const completer = completerModule.autocomplete ?? completerModule.default?.default ?? completerModule.default ?? completerModule;
|
|
222
222
|
if (typeof completer !== "object" || !completer.name || completer.disabled) return false;
|
|
223
223
|
if (!reload && this.client.autocomplete.has(completer.id)) throw new FrameworkError("ComponentAlreadyLoaded", "autocomplete", completer.id);
|
|
224
224
|
completer.filepath = filepath;
|
|
@@ -289,7 +289,7 @@ var ListenerModule = class {
|
|
|
289
289
|
}
|
|
290
290
|
async load(filepath, reload = false) {
|
|
291
291
|
const listenerModule = await import(pathToFileURL2(filepath).href);
|
|
292
|
-
const listener = listenerModule.listener ?? listenerModule.default ?? listenerModule;
|
|
292
|
+
const listener = listenerModule.listener ?? listenerModule.default?.default ?? listenerModule.default ?? listenerModule;
|
|
293
293
|
if (typeof listener !== "object" || !listener.name || listener.disabled) return false;
|
|
294
294
|
if (!reload && this.client.events.has(listener.id)) throw new FrameworkError("ComponentAlreadyLoaded", "listener", listener.id);
|
|
295
295
|
listener.filepath = filepath;
|
|
@@ -561,9 +561,9 @@ var FrameworkClient = class extends DiscordClient {
|
|
|
561
561
|
});
|
|
562
562
|
}
|
|
563
563
|
async start(token) {
|
|
564
|
+
await this.listenerModule.loadAll();
|
|
564
565
|
await this.autocompleteModule.loadAll();
|
|
565
566
|
await this.commandsModule.loadAll();
|
|
566
|
-
await this.listenerModule.loadAll();
|
|
567
567
|
await this.login(token);
|
|
568
568
|
}
|
|
569
569
|
};
|
|
@@ -640,9 +640,9 @@ import {
|
|
|
640
640
|
SlashCommandNumberOption,
|
|
641
641
|
SlashCommandRoleOption,
|
|
642
642
|
SlashCommandStringOption,
|
|
643
|
+
SlashCommandUserOption,
|
|
643
644
|
SlashCommandSubcommandBuilder,
|
|
644
|
-
SlashCommandSubcommandGroupBuilder
|
|
645
|
-
SlashCommandOptionsOnlyBuilder
|
|
645
|
+
SlashCommandSubcommandGroupBuilder
|
|
646
646
|
} from "discord.js";
|
|
647
647
|
export {
|
|
648
648
|
SlashCommandAttachmentOption as AttachmentOption,
|
|
@@ -658,8 +658,8 @@ export {
|
|
|
658
658
|
SlashCommandNumberOption as NumberOption,
|
|
659
659
|
SlashCommandRoleOption as RoleOption,
|
|
660
660
|
SlashCommand,
|
|
661
|
-
SlashCommandOptionsOnlyBuilder as SlashCommandOptionsBuilder,
|
|
662
661
|
SlashCommandStringOption as StringOption,
|
|
663
662
|
SlashCommandSubcommandBuilder as SubcommandBuilder,
|
|
664
|
-
SlashCommandSubcommandGroupBuilder as SubcommandGroupBuilder
|
|
663
|
+
SlashCommandSubcommandGroupBuilder as SubcommandGroupBuilder,
|
|
664
|
+
SlashCommandUserOption as UserOption
|
|
665
665
|
};
|