vimcord 1.0.37 → 1.0.38
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/index.cjs +17 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +17 -11
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as discord_js from 'discord.js';
|
|
2
2
|
import { SlashCommandBuilder as SlashCommandBuilder$1, SlashCommandOptionsOnlyBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandsOnlyBuilder, SlashCommandSubcommandGroupBuilder, PermissionResolvable, ChatInputCommandInteraction, Message, ContextMenuCommandInteraction, ContextMenuCommandBuilder, ClientEvents, ActivityType, Guild, CommandInteraction, ColorResolvable, ButtonComponentData, APIThumbnailComponent, ActionRowBuilder, MessageActionRowComponentBuilder, ContainerBuilder, BaseMessageOptions, StickerResolvable, PollData, InteractionReplyOptions, MessageMentionOptions, ReplyOptions, ForwardOptions, Client, TextBasedChannel, GuildMember, User, APIEmbedField, APIEmbed, EmbedBuilder, RepliableInteraction, DMChannel, TextChannel, NewsChannel, ThreadChannel, ClientOptions, MessageComponentType, InteractionCollector, MappedInteractionTypes, UserResolvable as UserResolvable$1, AwaitModalSubmitOptions, ModalSubmitInteraction, APIChannelSelectComponent, APIFileUploadComponent, APIMentionableSelectComponent, APITextInputComponent, APIStringSelectComponent, APIUserSelectComponent, APIRoleSelectComponent, APIModalInteractionResponseCallbackData, ModalBuilder, Interaction, InteractionDeferUpdateOptions, InteractionResponse, MessagePayload, AttachmentBuilder, SelectMenuComponentOptionData, StringSelectMenuOptionBuilder, StringSelectMenuInteraction, ButtonInteraction, MessageReaction, ButtonBuilder, StringSelectMenuBuilder, ReactionCollector, APIButtonComponent, ChannelType, PartialGroupDMChannel, PartialDMChannel, GuildBasedChannel, AnyThreadChannel, VoiceBasedChannel, CategoryChannel, Channel, Role, GuildTextBasedChannel } from 'discord.js';
|
|
3
|
+
import * as type_fest from 'type-fest';
|
|
3
4
|
import { PartialDeep } from 'type-fest';
|
|
4
5
|
import EventEmitter from 'node:events';
|
|
5
6
|
import { Loop } from 'qznt';
|
|
@@ -1374,17 +1375,17 @@ declare function defineVimcordConfig(config: PartialDeep<VimcordConfig>): Vimcor
|
|
|
1374
1375
|
* Returns an instance of Vimcord.
|
|
1375
1376
|
* @param clientId [default: 0]
|
|
1376
1377
|
*/
|
|
1377
|
-
declare
|
|
1378
|
+
declare function useClient(clientId?: number): Vimcord<boolean> | undefined;
|
|
1378
1379
|
/**
|
|
1379
1380
|
* Waits for a Vimcord instance to be ready.
|
|
1380
1381
|
* @param clientId [default: 0]
|
|
1381
1382
|
* @param timeoutMs [default: 60000]
|
|
1382
1383
|
*/
|
|
1383
|
-
declare
|
|
1384
|
+
declare function useReadyClient(clientId?: number, timeoutMs?: number): Promise<Vimcord<true>>;
|
|
1384
1385
|
/**
|
|
1385
1386
|
* Creates a new instance of Vimcord.
|
|
1386
1387
|
*/
|
|
1387
|
-
declare
|
|
1388
|
+
declare function createClient(options: discord_js.ClientOptions, features?: VimcordFeatures, config?: type_fest.PartialDeep<VimcordConfig>): Vimcord<boolean>;
|
|
1388
1389
|
|
|
1389
1390
|
declare abstract class BaseCommandBuilder<T extends CommandType, O extends BaseCommandConfig<T> = BaseCommandConfig<T>> {
|
|
1390
1391
|
readonly uuid: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as discord_js from 'discord.js';
|
|
2
2
|
import { SlashCommandBuilder as SlashCommandBuilder$1, SlashCommandOptionsOnlyBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandsOnlyBuilder, SlashCommandSubcommandGroupBuilder, PermissionResolvable, ChatInputCommandInteraction, Message, ContextMenuCommandInteraction, ContextMenuCommandBuilder, ClientEvents, ActivityType, Guild, CommandInteraction, ColorResolvable, ButtonComponentData, APIThumbnailComponent, ActionRowBuilder, MessageActionRowComponentBuilder, ContainerBuilder, BaseMessageOptions, StickerResolvable, PollData, InteractionReplyOptions, MessageMentionOptions, ReplyOptions, ForwardOptions, Client, TextBasedChannel, GuildMember, User, APIEmbedField, APIEmbed, EmbedBuilder, RepliableInteraction, DMChannel, TextChannel, NewsChannel, ThreadChannel, ClientOptions, MessageComponentType, InteractionCollector, MappedInteractionTypes, UserResolvable as UserResolvable$1, AwaitModalSubmitOptions, ModalSubmitInteraction, APIChannelSelectComponent, APIFileUploadComponent, APIMentionableSelectComponent, APITextInputComponent, APIStringSelectComponent, APIUserSelectComponent, APIRoleSelectComponent, APIModalInteractionResponseCallbackData, ModalBuilder, Interaction, InteractionDeferUpdateOptions, InteractionResponse, MessagePayload, AttachmentBuilder, SelectMenuComponentOptionData, StringSelectMenuOptionBuilder, StringSelectMenuInteraction, ButtonInteraction, MessageReaction, ButtonBuilder, StringSelectMenuBuilder, ReactionCollector, APIButtonComponent, ChannelType, PartialGroupDMChannel, PartialDMChannel, GuildBasedChannel, AnyThreadChannel, VoiceBasedChannel, CategoryChannel, Channel, Role, GuildTextBasedChannel } from 'discord.js';
|
|
3
|
+
import * as type_fest from 'type-fest';
|
|
3
4
|
import { PartialDeep } from 'type-fest';
|
|
4
5
|
import EventEmitter from 'node:events';
|
|
5
6
|
import { Loop } from 'qznt';
|
|
@@ -1374,17 +1375,17 @@ declare function defineVimcordConfig(config: PartialDeep<VimcordConfig>): Vimcor
|
|
|
1374
1375
|
* Returns an instance of Vimcord.
|
|
1375
1376
|
* @param clientId [default: 0]
|
|
1376
1377
|
*/
|
|
1377
|
-
declare
|
|
1378
|
+
declare function useClient(clientId?: number): Vimcord<boolean> | undefined;
|
|
1378
1379
|
/**
|
|
1379
1380
|
* Waits for a Vimcord instance to be ready.
|
|
1380
1381
|
* @param clientId [default: 0]
|
|
1381
1382
|
* @param timeoutMs [default: 60000]
|
|
1382
1383
|
*/
|
|
1383
|
-
declare
|
|
1384
|
+
declare function useReadyClient(clientId?: number, timeoutMs?: number): Promise<Vimcord<true>>;
|
|
1384
1385
|
/**
|
|
1385
1386
|
* Creates a new instance of Vimcord.
|
|
1386
1387
|
*/
|
|
1387
|
-
declare
|
|
1388
|
+
declare function createClient(options: discord_js.ClientOptions, features?: VimcordFeatures, config?: type_fest.PartialDeep<VimcordConfig>): Vimcord<boolean>;
|
|
1388
1389
|
|
|
1389
1390
|
declare abstract class BaseCommandBuilder<T extends CommandType, O extends BaseCommandConfig<T> = BaseCommandConfig<T>> {
|
|
1390
1391
|
readonly uuid: string;
|
package/dist/index.js
CHANGED
|
@@ -1660,7 +1660,7 @@ var ErrorHandler = class {
|
|
|
1660
1660
|
import chalk2 from "chalk";
|
|
1661
1661
|
|
|
1662
1662
|
// package.json
|
|
1663
|
-
var version = "1.0.
|
|
1663
|
+
var version = "1.0.38";
|
|
1664
1664
|
|
|
1665
1665
|
// src/client/vimcord.logger.ts
|
|
1666
1666
|
var clientLoggerFactory = (client) => new Logger({ prefixEmoji: "\u26A1", prefix: `vimcord (i${client.clientId})` }).extend({
|
|
@@ -1803,31 +1803,31 @@ var configSetters = {
|
|
|
1803
1803
|
app: createAppConfig,
|
|
1804
1804
|
staff: createStaffConfig,
|
|
1805
1805
|
slashCommands: createSlashCommandConfig,
|
|
1806
|
-
|
|
1807
|
-
|
|
1806
|
+
contextCommands: createContextCommandConfig,
|
|
1807
|
+
prefixCommands: createPrefixCommandConfig
|
|
1808
1808
|
};
|
|
1809
1809
|
var moduleImporters = {
|
|
1810
1810
|
slashCommands: (client, options, set) => {
|
|
1811
1811
|
const opt = options;
|
|
1812
|
-
const dir = Array.isArray(options) ? options :
|
|
1812
|
+
const dir = Array.isArray(options) ? options : typeof options === "string" ? options : options?.dir ?? [];
|
|
1813
1813
|
const suffix = Array.isArray(options) ? DEFAULT_MODULE_SUFFIXES.slashCommands : opt?.suffix ?? DEFAULT_MODULE_SUFFIXES.slashCommands;
|
|
1814
1814
|
return client.commands.slash.importFrom(dir, set, suffix);
|
|
1815
1815
|
},
|
|
1816
1816
|
contextCommands: (client, options, set) => {
|
|
1817
1817
|
const opt = options;
|
|
1818
|
-
const dir = Array.isArray(options) ? options :
|
|
1818
|
+
const dir = Array.isArray(options) ? options : typeof options === "string" ? options : options?.dir ?? [];
|
|
1819
1819
|
const suffix = Array.isArray(options) ? DEFAULT_MODULE_SUFFIXES.contextCommands : opt?.suffix ?? DEFAULT_MODULE_SUFFIXES.contextCommands;
|
|
1820
1820
|
return client.commands.context.importFrom(dir, set, suffix);
|
|
1821
1821
|
},
|
|
1822
1822
|
prefixCommands: (client, options, set) => {
|
|
1823
1823
|
const opt = options;
|
|
1824
|
-
const dir = Array.isArray(options) ? options :
|
|
1824
|
+
const dir = Array.isArray(options) ? options : typeof options === "string" ? options : options?.dir ?? [];
|
|
1825
1825
|
const suffix = Array.isArray(options) ? DEFAULT_MODULE_SUFFIXES.prefixCommands : opt?.suffix ?? DEFAULT_MODULE_SUFFIXES.prefixCommands;
|
|
1826
1826
|
return client.commands.prefix.importFrom(dir, set, suffix);
|
|
1827
1827
|
},
|
|
1828
1828
|
events: (client, options, set) => {
|
|
1829
1829
|
const opt = options;
|
|
1830
|
-
const dir = Array.isArray(options) ? options :
|
|
1830
|
+
const dir = Array.isArray(options) ? options : typeof options === "string" ? options : options?.dir ?? [];
|
|
1831
1831
|
const suffix = Array.isArray(options) ? DEFAULT_MODULE_SUFFIXES.events : opt?.suffix ?? DEFAULT_MODULE_SUFFIXES.events;
|
|
1832
1832
|
return client.events.importFrom(dir, set, suffix);
|
|
1833
1833
|
}
|
|
@@ -1847,9 +1847,15 @@ function defineVimcordConfig(config) {
|
|
|
1847
1847
|
contextCommands: createContextCommandConfig(config.contextCommands)
|
|
1848
1848
|
};
|
|
1849
1849
|
}
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1850
|
+
function useClient(clientId) {
|
|
1851
|
+
return Vimcord.getInstance(clientId);
|
|
1852
|
+
}
|
|
1853
|
+
function useReadyClient(clientId, timeoutMs) {
|
|
1854
|
+
return Vimcord.getReadyInstance(clientId, timeoutMs);
|
|
1855
|
+
}
|
|
1856
|
+
function createClient(options, features, config) {
|
|
1857
|
+
return Vimcord.create(options, features, config);
|
|
1858
|
+
}
|
|
1853
1859
|
|
|
1854
1860
|
// src/modules/command.manager.ts
|
|
1855
1861
|
import { Routes } from "discord.js";
|
|
@@ -1866,7 +1872,7 @@ async function importModulesFromDir(dir, suffix) {
|
|
|
1866
1872
|
const cwd = getProcessDir();
|
|
1867
1873
|
const MODULE_RELATIVE_PATH = path.join(cwd, dir);
|
|
1868
1874
|
const MODULE_LOG_PATH = dir;
|
|
1869
|
-
const files = $.fs.readDir(MODULE_RELATIVE_PATH).filter((fn) => fn.endsWith(`${suffix ?
|
|
1875
|
+
const files = $.fs.readDir(MODULE_RELATIVE_PATH).filter((fn) => fn.endsWith(`${suffix ? `${suffix}` : ""}.js`) || fn.endsWith(`${suffix ? `${suffix}` : ""}.ts`));
|
|
1870
1876
|
if (!files.length) {
|
|
1871
1877
|
return [];
|
|
1872
1878
|
}
|