zumito-framework 1.22.1 → 1.23.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/ZumitoFramework.js +22 -5
- package/dist/definitions/Module.d.ts +11 -0
- package/dist/definitions/Module.js +3 -0
- package/dist/index.d.ts +2 -2
- package/dist/modules/core/baseModule/events/discord/MessageCreate.js +16 -0
- package/dist/services/handlers/InteractionHandler.js +45 -19
- package/dist/services/managers/ModuleManager.d.ts +14 -2
- package/dist/services/managers/ModuleManager.js +118 -1
- package/dist/testing/createTestFramework.d.ts +8 -8
- package/dist/testing/mocks/discord.d.ts +105 -105
- package/package.json +5 -5
package/dist/ZumitoFramework.js
CHANGED
|
@@ -316,27 +316,44 @@ export class ZumitoFramework {
|
|
|
316
316
|
modulesFolder = `${process.cwd()}/src/modules`;
|
|
317
317
|
}
|
|
318
318
|
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
319
|
+
const moduleEntries = [];
|
|
319
320
|
if (this.settings.bundles && this.settings.bundles.length > 0) {
|
|
320
321
|
for (const bundle of this.settings.bundles) {
|
|
321
|
-
|
|
322
|
+
moduleEntries.push({
|
|
323
|
+
rootPath: bundle.path,
|
|
324
|
+
options: bundle.options,
|
|
325
|
+
});
|
|
322
326
|
}
|
|
323
327
|
}
|
|
324
|
-
|
|
328
|
+
moduleEntries.push({
|
|
329
|
+
rootPath: path.join(__dirname, 'modules', 'core'),
|
|
330
|
+
name: 'baseModule',
|
|
331
|
+
});
|
|
325
332
|
if (fs.existsSync(`${process.cwd()}/node_modules/.zumitoBundles`)) {
|
|
326
333
|
const files = fs.readdirSync(`${process.cwd()}/node_modules/.zumitoBundles`);
|
|
327
334
|
for (const file of files) {
|
|
328
|
-
|
|
335
|
+
moduleEntries.push({
|
|
336
|
+
rootPath: path.join(process.cwd(), 'node_modules', '.zumitoBundles', file),
|
|
337
|
+
name: file,
|
|
338
|
+
});
|
|
329
339
|
}
|
|
330
340
|
}
|
|
331
341
|
if (modulesFolder) {
|
|
332
342
|
const files = fs.readdirSync(modulesFolder);
|
|
333
343
|
for (const file of files) {
|
|
334
|
-
|
|
344
|
+
moduleEntries.push({
|
|
345
|
+
rootPath: path.join(modulesFolder, file),
|
|
346
|
+
name: file,
|
|
347
|
+
});
|
|
335
348
|
}
|
|
336
349
|
}
|
|
337
350
|
else if (this.settings.srcMode == 'monoBundle') {
|
|
338
|
-
|
|
351
|
+
moduleEntries.push({
|
|
352
|
+
rootPath: path.join(process.cwd(), 'src'),
|
|
353
|
+
name: 'src',
|
|
354
|
+
});
|
|
339
355
|
}
|
|
356
|
+
await this.modules.resolveAndInstantiateAll(moduleEntries);
|
|
340
357
|
}
|
|
341
358
|
async registerModule(modulesFolder, moduleName, module) {
|
|
342
359
|
if (!module) {
|
|
@@ -8,11 +8,22 @@ export type ModuleRequeriments = {
|
|
|
8
8
|
services: Array<string>;
|
|
9
9
|
custom: Array<() => Promise<boolean>>;
|
|
10
10
|
};
|
|
11
|
+
export type ModuleDeclaration = {
|
|
12
|
+
moduleClass: typeof Module;
|
|
13
|
+
name: string;
|
|
14
|
+
rootPath: string;
|
|
15
|
+
options?: ModuleParameters;
|
|
16
|
+
requiredDeps: string[];
|
|
17
|
+
optionalDeps: string[];
|
|
18
|
+
};
|
|
11
19
|
export declare abstract class Module {
|
|
12
20
|
protected path: string;
|
|
13
21
|
protected parameters: ModuleParameters;
|
|
14
22
|
protected framework: ZumitoFramework;
|
|
15
23
|
protected events: Map<string, FrameworkEvent>;
|
|
24
|
+
static moduleName?: string;
|
|
25
|
+
static dependencies?: readonly string[];
|
|
26
|
+
static optionalDependencies?: readonly string[];
|
|
16
27
|
static requeriments: ModuleRequeriments;
|
|
17
28
|
protected errorHandler: ErrorHandler;
|
|
18
29
|
constructor(path: any, parameters?: ModuleParameters);
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { DatabaseConfigLoader } from './services/utilities/DatabaseConfigLoader.
|
|
|
12
12
|
import { EmojiFallback } from './services/EmojiFallback.js';
|
|
13
13
|
import { FrameworkEvent } from './definitions/FrameworkEvent.js';
|
|
14
14
|
import { FrameworkSettings } from './definitions/FrameworkSettings.js';
|
|
15
|
-
import { Module } from './definitions/Module.js';
|
|
15
|
+
import { Module, ModuleDeclaration, ModuleRequeriments } from './definitions/Module.js';
|
|
16
16
|
import { SelectMenuParameters } from './definitions/parameters/SelectMenuParameters.js';
|
|
17
17
|
import { TextFormatter } from './services/utilities/TextFormatter.js';
|
|
18
18
|
import { Translation } from './definitions/Translation.js';
|
|
@@ -42,4 +42,4 @@ export { CommandBinds } from './definitions/commands/CommandBinds.js';
|
|
|
42
42
|
export { Injectable } from './definitions/decorators/Injectable.decorator.js';
|
|
43
43
|
export { LauncherConfig } from './definitions/config/LauncherConfig.js';
|
|
44
44
|
export { ModuleParameters } from './definitions/parameters/ModuleParameters.js';
|
|
45
|
-
export { ZumitoFramework, FrameworkSettings, Command, Module, CommandParameters, CommandArguments, FrameworkEvent, Translation, TranslationManager, ApiResponse, SelectMenuParameters, CommandType, CommandArgDefinition, CommandChoiceDefinition, ButtonPressed, ButtonPressedParams, TextFormatter, EmojiFallback, DatabaseConfigLoader, PresenceDataRule, RuledPresenceData, StatusManagerOptions, discord, EventParameters, ServiceContainer, GuildDataGetter, SlashCommandRefresher, CommandParser, ErrorHandler, ErrorType, Route, RouteMethod, InteractionHandler, CommandManager, InviteUrlGenerator, PrefixResolver, CommandExecutionChecker, DatabaseManager, };
|
|
45
|
+
export { ZumitoFramework, FrameworkSettings, Command, Module, ModuleDeclaration, ModuleRequeriments, CommandParameters, CommandArguments, FrameworkEvent, Translation, TranslationManager, ApiResponse, SelectMenuParameters, CommandType, CommandArgDefinition, CommandChoiceDefinition, ButtonPressed, ButtonPressedParams, TextFormatter, EmojiFallback, DatabaseConfigLoader, PresenceDataRule, RuledPresenceData, StatusManagerOptions, discord, EventParameters, ServiceContainer, GuildDataGetter, SlashCommandRefresher, CommandParser, ErrorHandler, ErrorType, Route, RouteMethod, InteractionHandler, CommandManager, InviteUrlGenerator, PrefixResolver, CommandExecutionChecker, DatabaseManager, };
|
|
@@ -76,6 +76,7 @@ export class MessageCreate extends FrameworkEvent {
|
|
|
76
76
|
allowedMentions: { repliedUser: false },
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
+
const startTime = Date.now();
|
|
79
80
|
await commandInstance.execute({
|
|
80
81
|
message,
|
|
81
82
|
args: parsedArgs,
|
|
@@ -90,7 +91,22 @@ export class MessageCreate extends FrameworkEvent {
|
|
|
90
91
|
return this.framework.translations.get('command.' + commandInstance.name + '.' + key, guildSettings.lang, params);
|
|
91
92
|
}
|
|
92
93
|
},
|
|
94
|
+
}).then(() => {
|
|
95
|
+
this.framework.eventEmitter.emit('commandExecuted', {
|
|
96
|
+
guildId: message.guildId,
|
|
97
|
+
commandName: commandInstance.name,
|
|
98
|
+
type: 'prefix',
|
|
99
|
+
executionTimeMs: Date.now() - startTime,
|
|
100
|
+
success: true,
|
|
101
|
+
});
|
|
93
102
|
}).catch((error) => {
|
|
103
|
+
this.framework.eventEmitter.emit('commandExecuted', {
|
|
104
|
+
guildId: message.guildId,
|
|
105
|
+
commandName: commandInstance.name,
|
|
106
|
+
type: 'prefix',
|
|
107
|
+
executionTimeMs: Date.now() - startTime,
|
|
108
|
+
success: false,
|
|
109
|
+
});
|
|
94
110
|
const errorHandler = ServiceContainer.getService(ErrorHandler);
|
|
95
111
|
errorHandler.handleError(error, {
|
|
96
112
|
command: commandInstance,
|
|
@@ -112,31 +112,57 @@ export class InteractionHandler {
|
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
114
|
const trans = this.translationManager.getShortHandMethod('command.' + commandInstance.name, guildSettings?.lang);
|
|
115
|
+
const startTime = Date.now();
|
|
115
116
|
if (commandInstance.type === CommandType.separated ||
|
|
116
117
|
commandInstance.type === CommandType.slash) {
|
|
117
|
-
await commandInstance.executeSlashCommand({
|
|
118
|
-
client: this.client,
|
|
119
|
-
interaction, args, framework, guildSettings, trans,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
118
|
try {
|
|
124
|
-
await commandInstance.
|
|
119
|
+
await commandInstance.executeSlashCommand({
|
|
125
120
|
client: this.client,
|
|
126
121
|
interaction, args, framework, guildSettings, trans,
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
content: "An error ocurred while running this command.",
|
|
135
|
-
ephemeral: true
|
|
136
|
-
});
|
|
122
|
+
});
|
|
123
|
+
framework.eventEmitter.emit('commandExecuted', {
|
|
124
|
+
guildId: interaction.guildId,
|
|
125
|
+
commandName: commandInstance.name,
|
|
126
|
+
type: 'slash',
|
|
127
|
+
executionTimeMs: Date.now() - startTime,
|
|
128
|
+
success: true,
|
|
137
129
|
});
|
|
138
130
|
}
|
|
139
131
|
catch (error) {
|
|
132
|
+
framework.eventEmitter.emit('commandExecuted', {
|
|
133
|
+
guildId: interaction.guildId,
|
|
134
|
+
commandName: commandInstance.name,
|
|
135
|
+
type: 'slash',
|
|
136
|
+
executionTimeMs: Date.now() - startTime,
|
|
137
|
+
success: false,
|
|
138
|
+
});
|
|
139
|
+
this.errorHandler.handleError(error, {
|
|
140
|
+
command: commandInstance,
|
|
141
|
+
type: ErrorType.CommandRun,
|
|
142
|
+
interaction,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
await commandInstance.execute({
|
|
148
|
+
client: this.client,
|
|
149
|
+
interaction, args, framework, guildSettings, trans,
|
|
150
|
+
}).then(() => {
|
|
151
|
+
framework.eventEmitter.emit('commandExecuted', {
|
|
152
|
+
guildId: interaction.guildId,
|
|
153
|
+
commandName: commandInstance.name,
|
|
154
|
+
type: 'slash',
|
|
155
|
+
executionTimeMs: Date.now() - startTime,
|
|
156
|
+
success: true,
|
|
157
|
+
});
|
|
158
|
+
}).catch((error) => {
|
|
159
|
+
framework.eventEmitter.emit('commandExecuted', {
|
|
160
|
+
guildId: interaction.guildId,
|
|
161
|
+
commandName: commandInstance.name,
|
|
162
|
+
type: 'slash',
|
|
163
|
+
executionTimeMs: Date.now() - startTime,
|
|
164
|
+
success: false,
|
|
165
|
+
});
|
|
140
166
|
this.errorHandler.handleError(error, {
|
|
141
167
|
command: commandInstance,
|
|
142
168
|
type: ErrorType.CommandRun,
|
|
@@ -144,9 +170,9 @@ export class InteractionHandler {
|
|
|
144
170
|
});
|
|
145
171
|
interaction.reply({
|
|
146
172
|
content: "An error ocurred while running this command.",
|
|
147
|
-
ephemeral: true
|
|
173
|
+
ephemeral: true
|
|
148
174
|
});
|
|
149
|
-
}
|
|
175
|
+
});
|
|
150
176
|
}
|
|
151
177
|
}
|
|
152
178
|
async handleButtonInteraction(interaction, guildSettings) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ZumitoFramework } from "../../ZumitoFramework.js";
|
|
2
|
-
import { Module } from "../../definitions/Module.js";
|
|
2
|
+
import { Module, ModuleDeclaration } from "../../definitions/Module.js";
|
|
3
3
|
import { ErrorHandler } from "../handlers/ErrorHandler.js";
|
|
4
4
|
import { ModuleParameters } from "../../definitions/parameters/ModuleParameters.js";
|
|
5
5
|
export declare class ModuleManager {
|
|
@@ -20,7 +20,19 @@ export declare class ModuleManager {
|
|
|
20
20
|
* @deprecated
|
|
21
21
|
*/
|
|
22
22
|
get size(): number;
|
|
23
|
-
|
|
23
|
+
resolveModuleName(moduleClass: typeof Module, fallbackName: string): string;
|
|
24
|
+
resolveModuleDeps(moduleClass: typeof Module): {
|
|
25
|
+
required: string[];
|
|
26
|
+
optional: string[];
|
|
27
|
+
};
|
|
28
|
+
buildDependencyGraph(declarations: ModuleDeclaration[]): Map<string, string[]>;
|
|
29
|
+
topologicalSort(declarations: ModuleDeclaration[]): ModuleDeclaration[];
|
|
30
|
+
resolveAndInstantiateAll(modulePaths: Array<{
|
|
31
|
+
rootPath: string;
|
|
32
|
+
options?: ModuleParameters;
|
|
33
|
+
name?: string;
|
|
34
|
+
}>): Promise<void>;
|
|
35
|
+
loadModuleFile(folderPath: string): Promise<typeof Module | undefined>;
|
|
24
36
|
registerModule(module: InstanceType<typeof Module>): void;
|
|
25
37
|
instanceModule(module: any, rootPath: string, name?: string, options?: ModuleParameters): Promise<Module | {
|
|
26
38
|
modules: string[];
|
|
@@ -30,6 +30,123 @@ export class ModuleManager {
|
|
|
30
30
|
get size() {
|
|
31
31
|
return this.modules.size;
|
|
32
32
|
}
|
|
33
|
+
resolveModuleName(moduleClass, fallbackName) {
|
|
34
|
+
return moduleClass.moduleName || fallbackName;
|
|
35
|
+
}
|
|
36
|
+
resolveModuleDeps(moduleClass) {
|
|
37
|
+
const required = new Set();
|
|
38
|
+
const optional = new Set();
|
|
39
|
+
if (moduleClass.dependencies) {
|
|
40
|
+
for (const d of moduleClass.dependencies)
|
|
41
|
+
required.add(d);
|
|
42
|
+
}
|
|
43
|
+
if (moduleClass.optionalDependencies) {
|
|
44
|
+
for (const d of moduleClass.optionalDependencies)
|
|
45
|
+
optional.add(d);
|
|
46
|
+
}
|
|
47
|
+
if (moduleClass.requeriments?.modules) {
|
|
48
|
+
for (const m of moduleClass.requeriments.modules)
|
|
49
|
+
required.add(m);
|
|
50
|
+
}
|
|
51
|
+
return { required: [...required], optional: [...optional] };
|
|
52
|
+
}
|
|
53
|
+
buildDependencyGraph(declarations) {
|
|
54
|
+
const nameSet = new Set(declarations.map((d) => d.name));
|
|
55
|
+
const graph = new Map();
|
|
56
|
+
for (const decl of declarations) {
|
|
57
|
+
const deps = [...decl.requiredDeps];
|
|
58
|
+
for (const opt of decl.optionalDeps) {
|
|
59
|
+
if (nameSet.has(opt))
|
|
60
|
+
deps.push(opt);
|
|
61
|
+
}
|
|
62
|
+
for (const dep of deps) {
|
|
63
|
+
if (!nameSet.has(dep)) {
|
|
64
|
+
throw new Error(`Module "${decl.name}" depends on "${dep}" which was not found`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
graph.set(decl.name, deps);
|
|
68
|
+
}
|
|
69
|
+
return graph;
|
|
70
|
+
}
|
|
71
|
+
topologicalSort(declarations) {
|
|
72
|
+
const graph = this.buildDependencyGraph(declarations);
|
|
73
|
+
const inDegree = new Map();
|
|
74
|
+
const adjacency = new Map();
|
|
75
|
+
for (const decl of declarations) {
|
|
76
|
+
const name = decl.name;
|
|
77
|
+
if (!inDegree.has(name))
|
|
78
|
+
inDegree.set(name, 0);
|
|
79
|
+
if (!adjacency.has(name))
|
|
80
|
+
adjacency.set(name, []);
|
|
81
|
+
}
|
|
82
|
+
for (const [name, deps] of graph) {
|
|
83
|
+
for (const dep of deps) {
|
|
84
|
+
if (!adjacency.has(dep))
|
|
85
|
+
adjacency.set(dep, []);
|
|
86
|
+
adjacency.get(dep).push(name);
|
|
87
|
+
inDegree.set(name, (inDegree.get(name) || 0) + 1);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const queue = [];
|
|
91
|
+
for (const [name, degree] of inDegree) {
|
|
92
|
+
if (degree === 0)
|
|
93
|
+
queue.push(name);
|
|
94
|
+
}
|
|
95
|
+
const sorted = [];
|
|
96
|
+
while (queue.length > 0) {
|
|
97
|
+
const current = queue.shift();
|
|
98
|
+
sorted.push(current);
|
|
99
|
+
for (const neighbor of adjacency.get(current) || []) {
|
|
100
|
+
const newDegree = inDegree.get(neighbor) - 1;
|
|
101
|
+
inDegree.set(neighbor, newDegree);
|
|
102
|
+
if (newDegree === 0)
|
|
103
|
+
queue.push(neighbor);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (sorted.length < declarations.length) {
|
|
107
|
+
const unresolved = declarations
|
|
108
|
+
.filter((d) => !sorted.includes(d.name))
|
|
109
|
+
.map((d) => d.name);
|
|
110
|
+
throw new Error(`Circular dependency detected involving: ${unresolved.join(', ')}`);
|
|
111
|
+
}
|
|
112
|
+
const nameMap = new Map(declarations.map((d) => [d.name, d]));
|
|
113
|
+
return sorted.map((name) => nameMap.get(name));
|
|
114
|
+
}
|
|
115
|
+
async resolveAndInstantiateAll(modulePaths) {
|
|
116
|
+
const declarations = [];
|
|
117
|
+
for (const entry of modulePaths) {
|
|
118
|
+
const moduleClass = await this.loadModuleFile(entry.rootPath);
|
|
119
|
+
if (!moduleClass || moduleClass === Module)
|
|
120
|
+
continue;
|
|
121
|
+
const { required, optional } = this.resolveModuleDeps(moduleClass);
|
|
122
|
+
const name = this.resolveModuleName(moduleClass, entry.name || path.basename(entry.rootPath));
|
|
123
|
+
declarations.push({
|
|
124
|
+
moduleClass,
|
|
125
|
+
name,
|
|
126
|
+
rootPath: entry.rootPath,
|
|
127
|
+
options: entry.options,
|
|
128
|
+
requiredDeps: required,
|
|
129
|
+
optionalDeps: optional,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
if (declarations.length === 0)
|
|
133
|
+
return;
|
|
134
|
+
let sorted;
|
|
135
|
+
try {
|
|
136
|
+
sorted = this.topologicalSort(declarations);
|
|
137
|
+
}
|
|
138
|
+
catch (err) {
|
|
139
|
+
console.error(`[📦❌] ${err.message}`);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
for (const decl of sorted) {
|
|
143
|
+
const result = await this.instanceModule(decl.moduleClass, decl.rootPath, decl.name, decl.options);
|
|
144
|
+
if (result instanceof Module) {
|
|
145
|
+
console.log(`[📦✅] Module "${decl.name}" loaded successfully`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
await this.initializePendingModules();
|
|
149
|
+
}
|
|
33
150
|
async loadModuleFile(folderPath) {
|
|
34
151
|
let file;
|
|
35
152
|
if (fs.existsSync(path.join(folderPath, 'index.js'))) {
|
|
@@ -46,7 +163,7 @@ export class ModuleManager {
|
|
|
46
163
|
const moduleClass = exports.find((candidate) => {
|
|
47
164
|
return Object.getPrototypeOf(candidate).name === 'Module';
|
|
48
165
|
});
|
|
49
|
-
return moduleClass || exports[0];
|
|
166
|
+
return (moduleClass || exports[0]);
|
|
50
167
|
}
|
|
51
168
|
registerModule(module) {
|
|
52
169
|
// Register module events
|
|
@@ -3,18 +3,18 @@ export declare function createTestFramework(overrides?: Record<string, any>): {
|
|
|
3
3
|
framework: any;
|
|
4
4
|
client: {
|
|
5
5
|
_listeners: Record<string, ((...args: any[]) => void)[]>;
|
|
6
|
-
on: import("vitest").Mock<
|
|
7
|
-
once: import("vitest").Mock<
|
|
8
|
-
emit: import("vitest").Mock<
|
|
9
|
-
login: import("vitest").Mock<
|
|
10
|
-
destroy: import("vitest").Mock<
|
|
6
|
+
on: import("vitest").Mock<(event: string, cb: (...args: any[]) => void) => void>;
|
|
7
|
+
once: import("vitest").Mock<(event: string, cb: (...args: any[]) => void) => void>;
|
|
8
|
+
emit: import("vitest").Mock<(event: string, ...args: any[]) => void>;
|
|
9
|
+
login: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
10
|
+
destroy: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
11
11
|
guilds: {
|
|
12
12
|
cache: Map<any, any>;
|
|
13
|
-
fetch: import("vitest").Mock<
|
|
13
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
14
14
|
};
|
|
15
15
|
channels: {
|
|
16
16
|
cache: Map<any, any>;
|
|
17
|
-
fetch: import("vitest").Mock<
|
|
17
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
18
18
|
};
|
|
19
19
|
user: {
|
|
20
20
|
id: string;
|
|
@@ -22,7 +22,7 @@ export declare function createTestFramework(overrides?: Record<string, any>): {
|
|
|
22
22
|
username: string;
|
|
23
23
|
};
|
|
24
24
|
users: {
|
|
25
|
-
fetch: import("vitest").Mock<
|
|
25
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
26
26
|
};
|
|
27
27
|
options: {};
|
|
28
28
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export declare function createMockClient(overrides?: Record<string, any>): {
|
|
2
2
|
_listeners: Record<string, ((...args: any[]) => void)[]>;
|
|
3
|
-
on: import("vitest").Mock<
|
|
4
|
-
once: import("vitest").Mock<
|
|
5
|
-
emit: import("vitest").Mock<
|
|
6
|
-
login: import("vitest").Mock<
|
|
7
|
-
destroy: import("vitest").Mock<
|
|
3
|
+
on: import("vitest").Mock<(event: string, cb: (...args: any[]) => void) => void>;
|
|
4
|
+
once: import("vitest").Mock<(event: string, cb: (...args: any[]) => void) => void>;
|
|
5
|
+
emit: import("vitest").Mock<(event: string, ...args: any[]) => void>;
|
|
6
|
+
login: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
7
|
+
destroy: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
8
8
|
guilds: {
|
|
9
9
|
cache: Map<any, any>;
|
|
10
|
-
fetch: import("vitest").Mock<
|
|
10
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
11
11
|
};
|
|
12
12
|
channels: {
|
|
13
13
|
cache: Map<any, any>;
|
|
14
|
-
fetch: import("vitest").Mock<
|
|
14
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
15
15
|
};
|
|
16
16
|
user: {
|
|
17
17
|
id: string;
|
|
@@ -19,7 +19,7 @@ export declare function createMockClient(overrides?: Record<string, any>): {
|
|
|
19
19
|
username: string;
|
|
20
20
|
};
|
|
21
21
|
users: {
|
|
22
|
-
fetch: import("vitest").Mock<
|
|
22
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
23
23
|
};
|
|
24
24
|
options: {};
|
|
25
25
|
};
|
|
@@ -29,11 +29,11 @@ export declare function createMockGuild(overrides?: Record<string, any>): {
|
|
|
29
29
|
ownerId: string;
|
|
30
30
|
channels: {
|
|
31
31
|
cache: Map<any, any>;
|
|
32
|
-
fetch: import("vitest").Mock<
|
|
32
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
33
33
|
};
|
|
34
34
|
members: {
|
|
35
35
|
cache: Map<any, any>;
|
|
36
|
-
fetch: import("vitest").Mock<
|
|
36
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
37
37
|
};
|
|
38
38
|
roles: {
|
|
39
39
|
cache: Map<any, any>;
|
|
@@ -49,21 +49,21 @@ export declare function createMockTextChannel(overrides?: Record<string, any>):
|
|
|
49
49
|
ownerId: string;
|
|
50
50
|
channels: {
|
|
51
51
|
cache: Map<any, any>;
|
|
52
|
-
fetch: import("vitest").Mock<
|
|
52
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
53
53
|
};
|
|
54
54
|
members: {
|
|
55
55
|
cache: Map<any, any>;
|
|
56
|
-
fetch: import("vitest").Mock<
|
|
56
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
57
57
|
};
|
|
58
58
|
roles: {
|
|
59
59
|
cache: Map<any, any>;
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
-
isTextBased: import("vitest").Mock<
|
|
63
|
-
isDMBased: import("vitest").Mock<
|
|
62
|
+
isTextBased: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
63
|
+
isDMBased: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
64
64
|
nsfw: boolean;
|
|
65
|
-
send: import("vitest").Mock<
|
|
66
|
-
permissionsFor: import("vitest").Mock<
|
|
65
|
+
send: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
66
|
+
permissionsFor: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
67
67
|
};
|
|
68
68
|
export declare function createMockGuildMember(overrides?: Record<string, any>): {
|
|
69
69
|
id: string;
|
|
@@ -77,18 +77,18 @@ export declare function createMockGuildMember(overrides?: Record<string, any>):
|
|
|
77
77
|
ownerId: string;
|
|
78
78
|
channels: {
|
|
79
79
|
cache: Map<any, any>;
|
|
80
|
-
fetch: import("vitest").Mock<
|
|
80
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
81
81
|
};
|
|
82
82
|
members: {
|
|
83
83
|
cache: Map<any, any>;
|
|
84
|
-
fetch: import("vitest").Mock<
|
|
84
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
85
85
|
};
|
|
86
86
|
roles: {
|
|
87
87
|
cache: Map<any, any>;
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
permissions: {
|
|
91
|
-
has: import("vitest").Mock<
|
|
91
|
+
has: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
92
92
|
};
|
|
93
93
|
roles: {
|
|
94
94
|
cache: Map<any, any>;
|
|
@@ -109,18 +109,18 @@ export declare function createMockMessage(overrides?: Record<string, any>): {
|
|
|
109
109
|
ownerId: string;
|
|
110
110
|
channels: {
|
|
111
111
|
cache: Map<any, any>;
|
|
112
|
-
fetch: import("vitest").Mock<
|
|
112
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
113
113
|
};
|
|
114
114
|
members: {
|
|
115
115
|
cache: Map<any, any>;
|
|
116
|
-
fetch: import("vitest").Mock<
|
|
116
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
117
117
|
};
|
|
118
118
|
roles: {
|
|
119
119
|
cache: Map<any, any>;
|
|
120
120
|
};
|
|
121
121
|
};
|
|
122
122
|
permissions: {
|
|
123
|
-
has: import("vitest").Mock<
|
|
123
|
+
has: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
124
124
|
};
|
|
125
125
|
roles: {
|
|
126
126
|
cache: Map<any, any>;
|
|
@@ -136,21 +136,21 @@ export declare function createMockMessage(overrides?: Record<string, any>): {
|
|
|
136
136
|
ownerId: string;
|
|
137
137
|
channels: {
|
|
138
138
|
cache: Map<any, any>;
|
|
139
|
-
fetch: import("vitest").Mock<
|
|
139
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
140
140
|
};
|
|
141
141
|
members: {
|
|
142
142
|
cache: Map<any, any>;
|
|
143
|
-
fetch: import("vitest").Mock<
|
|
143
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
144
144
|
};
|
|
145
145
|
roles: {
|
|
146
146
|
cache: Map<any, any>;
|
|
147
147
|
};
|
|
148
148
|
};
|
|
149
|
-
isTextBased: import("vitest").Mock<
|
|
150
|
-
isDMBased: import("vitest").Mock<
|
|
149
|
+
isTextBased: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
150
|
+
isDMBased: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
151
151
|
nsfw: boolean;
|
|
152
|
-
send: import("vitest").Mock<
|
|
153
|
-
permissionsFor: import("vitest").Mock<
|
|
152
|
+
send: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
153
|
+
permissionsFor: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
154
154
|
};
|
|
155
155
|
guild: {
|
|
156
156
|
id: string;
|
|
@@ -158,11 +158,11 @@ export declare function createMockMessage(overrides?: Record<string, any>): {
|
|
|
158
158
|
ownerId: string;
|
|
159
159
|
channels: {
|
|
160
160
|
cache: Map<any, any>;
|
|
161
|
-
fetch: import("vitest").Mock<
|
|
161
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
162
162
|
};
|
|
163
163
|
members: {
|
|
164
164
|
cache: Map<any, any>;
|
|
165
|
-
fetch: import("vitest").Mock<
|
|
165
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
166
166
|
};
|
|
167
167
|
roles: {
|
|
168
168
|
cache: Map<any, any>;
|
|
@@ -181,26 +181,26 @@ export declare function createMockMessage(overrides?: Record<string, any>): {
|
|
|
181
181
|
ownerId: string;
|
|
182
182
|
channels: {
|
|
183
183
|
cache: Map<any, any>;
|
|
184
|
-
fetch: import("vitest").Mock<
|
|
184
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
185
185
|
};
|
|
186
186
|
members: {
|
|
187
187
|
cache: Map<any, any>;
|
|
188
|
-
fetch: import("vitest").Mock<
|
|
188
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
189
189
|
};
|
|
190
190
|
roles: {
|
|
191
191
|
cache: Map<any, any>;
|
|
192
192
|
};
|
|
193
193
|
};
|
|
194
194
|
permissions: {
|
|
195
|
-
has: import("vitest").Mock<
|
|
195
|
+
has: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
196
196
|
};
|
|
197
197
|
roles: {
|
|
198
198
|
cache: Map<any, any>;
|
|
199
199
|
};
|
|
200
200
|
};
|
|
201
|
-
reply: import("vitest").Mock<
|
|
202
|
-
delete: import("vitest").Mock<
|
|
203
|
-
react: import("vitest").Mock<
|
|
201
|
+
reply: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
202
|
+
delete: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
203
|
+
react: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
204
204
|
editable: boolean;
|
|
205
205
|
deletable: boolean;
|
|
206
206
|
};
|
|
@@ -213,11 +213,11 @@ export declare function createMockCommandInteraction(overrides?: Record<string,
|
|
|
213
213
|
ownerId: string;
|
|
214
214
|
channels: {
|
|
215
215
|
cache: Map<any, any>;
|
|
216
|
-
fetch: import("vitest").Mock<
|
|
216
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
217
217
|
};
|
|
218
218
|
members: {
|
|
219
219
|
cache: Map<any, any>;
|
|
220
|
-
fetch: import("vitest").Mock<
|
|
220
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
221
221
|
};
|
|
222
222
|
roles: {
|
|
223
223
|
cache: Map<any, any>;
|
|
@@ -234,21 +234,21 @@ export declare function createMockCommandInteraction(overrides?: Record<string,
|
|
|
234
234
|
ownerId: string;
|
|
235
235
|
channels: {
|
|
236
236
|
cache: Map<any, any>;
|
|
237
|
-
fetch: import("vitest").Mock<
|
|
237
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
238
238
|
};
|
|
239
239
|
members: {
|
|
240
240
|
cache: Map<any, any>;
|
|
241
|
-
fetch: import("vitest").Mock<
|
|
241
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
242
242
|
};
|
|
243
243
|
roles: {
|
|
244
244
|
cache: Map<any, any>;
|
|
245
245
|
};
|
|
246
246
|
};
|
|
247
|
-
isTextBased: import("vitest").Mock<
|
|
248
|
-
isDMBased: import("vitest").Mock<
|
|
247
|
+
isTextBased: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
248
|
+
isDMBased: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
249
249
|
nsfw: boolean;
|
|
250
|
-
send: import("vitest").Mock<
|
|
251
|
-
permissionsFor: import("vitest").Mock<
|
|
250
|
+
send: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
251
|
+
permissionsFor: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
252
252
|
};
|
|
253
253
|
member: {
|
|
254
254
|
id: string;
|
|
@@ -262,18 +262,18 @@ export declare function createMockCommandInteraction(overrides?: Record<string,
|
|
|
262
262
|
ownerId: string;
|
|
263
263
|
channels: {
|
|
264
264
|
cache: Map<any, any>;
|
|
265
|
-
fetch: import("vitest").Mock<
|
|
265
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
266
266
|
};
|
|
267
267
|
members: {
|
|
268
268
|
cache: Map<any, any>;
|
|
269
|
-
fetch: import("vitest").Mock<
|
|
269
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
270
270
|
};
|
|
271
271
|
roles: {
|
|
272
272
|
cache: Map<any, any>;
|
|
273
273
|
};
|
|
274
274
|
};
|
|
275
275
|
permissions: {
|
|
276
|
-
has: import("vitest").Mock<
|
|
276
|
+
has: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
277
277
|
};
|
|
278
278
|
roles: {
|
|
279
279
|
cache: Map<any, any>;
|
|
@@ -283,19 +283,19 @@ export declare function createMockCommandInteraction(overrides?: Record<string,
|
|
|
283
283
|
id: string;
|
|
284
284
|
username: string;
|
|
285
285
|
};
|
|
286
|
-
reply: import("vitest").Mock<
|
|
287
|
-
deferReply: import("vitest").Mock<
|
|
288
|
-
editReply: import("vitest").Mock<
|
|
289
|
-
followUp: import("vitest").Mock<
|
|
286
|
+
reply: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
287
|
+
deferReply: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
288
|
+
editReply: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
289
|
+
followUp: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
290
290
|
options: {
|
|
291
|
-
get: import("vitest").Mock<
|
|
292
|
-
getString: import("vitest").Mock<
|
|
293
|
-
getInteger: import("vitest").Mock<
|
|
294
|
-
getBoolean: import("vitest").Mock<
|
|
295
|
-
getUser: import("vitest").Mock<
|
|
296
|
-
getChannel: import("vitest").Mock<
|
|
297
|
-
getRole: import("vitest").Mock<
|
|
298
|
-
getSubcommand: import("vitest").Mock<
|
|
291
|
+
get: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
292
|
+
getString: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
293
|
+
getInteger: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
294
|
+
getBoolean: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
295
|
+
getUser: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
296
|
+
getChannel: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
297
|
+
getRole: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
298
|
+
getSubcommand: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
299
299
|
};
|
|
300
300
|
};
|
|
301
301
|
export declare function createMockButtonInteraction(overrides?: Record<string, any>): {
|
|
@@ -307,11 +307,11 @@ export declare function createMockButtonInteraction(overrides?: Record<string, a
|
|
|
307
307
|
ownerId: string;
|
|
308
308
|
channels: {
|
|
309
309
|
cache: Map<any, any>;
|
|
310
|
-
fetch: import("vitest").Mock<
|
|
310
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
311
311
|
};
|
|
312
312
|
members: {
|
|
313
313
|
cache: Map<any, any>;
|
|
314
|
-
fetch: import("vitest").Mock<
|
|
314
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
315
315
|
};
|
|
316
316
|
roles: {
|
|
317
317
|
cache: Map<any, any>;
|
|
@@ -328,21 +328,21 @@ export declare function createMockButtonInteraction(overrides?: Record<string, a
|
|
|
328
328
|
ownerId: string;
|
|
329
329
|
channels: {
|
|
330
330
|
cache: Map<any, any>;
|
|
331
|
-
fetch: import("vitest").Mock<
|
|
331
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
332
332
|
};
|
|
333
333
|
members: {
|
|
334
334
|
cache: Map<any, any>;
|
|
335
|
-
fetch: import("vitest").Mock<
|
|
335
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
336
336
|
};
|
|
337
337
|
roles: {
|
|
338
338
|
cache: Map<any, any>;
|
|
339
339
|
};
|
|
340
340
|
};
|
|
341
|
-
isTextBased: import("vitest").Mock<
|
|
342
|
-
isDMBased: import("vitest").Mock<
|
|
341
|
+
isTextBased: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
342
|
+
isDMBased: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
343
343
|
nsfw: boolean;
|
|
344
|
-
send: import("vitest").Mock<
|
|
345
|
-
permissionsFor: import("vitest").Mock<
|
|
344
|
+
send: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
345
|
+
permissionsFor: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
346
346
|
};
|
|
347
347
|
member: {
|
|
348
348
|
id: string;
|
|
@@ -356,18 +356,18 @@ export declare function createMockButtonInteraction(overrides?: Record<string, a
|
|
|
356
356
|
ownerId: string;
|
|
357
357
|
channels: {
|
|
358
358
|
cache: Map<any, any>;
|
|
359
|
-
fetch: import("vitest").Mock<
|
|
359
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
360
360
|
};
|
|
361
361
|
members: {
|
|
362
362
|
cache: Map<any, any>;
|
|
363
|
-
fetch: import("vitest").Mock<
|
|
363
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
364
364
|
};
|
|
365
365
|
roles: {
|
|
366
366
|
cache: Map<any, any>;
|
|
367
367
|
};
|
|
368
368
|
};
|
|
369
369
|
permissions: {
|
|
370
|
-
has: import("vitest").Mock<
|
|
370
|
+
has: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
371
371
|
};
|
|
372
372
|
roles: {
|
|
373
373
|
cache: Map<any, any>;
|
|
@@ -377,10 +377,10 @@ export declare function createMockButtonInteraction(overrides?: Record<string, a
|
|
|
377
377
|
id: string;
|
|
378
378
|
username: string;
|
|
379
379
|
};
|
|
380
|
-
reply: import("vitest").Mock<
|
|
381
|
-
deferReply: import("vitest").Mock<
|
|
382
|
-
deferUpdate: import("vitest").Mock<
|
|
383
|
-
update: import("vitest").Mock<
|
|
380
|
+
reply: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
381
|
+
deferReply: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
382
|
+
deferUpdate: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
383
|
+
update: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
384
384
|
};
|
|
385
385
|
export declare function createMockStringSelectMenuInteraction(overrides?: Record<string, any>): {
|
|
386
386
|
id: string;
|
|
@@ -392,11 +392,11 @@ export declare function createMockStringSelectMenuInteraction(overrides?: Record
|
|
|
392
392
|
ownerId: string;
|
|
393
393
|
channels: {
|
|
394
394
|
cache: Map<any, any>;
|
|
395
|
-
fetch: import("vitest").Mock<
|
|
395
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
396
396
|
};
|
|
397
397
|
members: {
|
|
398
398
|
cache: Map<any, any>;
|
|
399
|
-
fetch: import("vitest").Mock<
|
|
399
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
400
400
|
};
|
|
401
401
|
roles: {
|
|
402
402
|
cache: Map<any, any>;
|
|
@@ -413,21 +413,21 @@ export declare function createMockStringSelectMenuInteraction(overrides?: Record
|
|
|
413
413
|
ownerId: string;
|
|
414
414
|
channels: {
|
|
415
415
|
cache: Map<any, any>;
|
|
416
|
-
fetch: import("vitest").Mock<
|
|
416
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
417
417
|
};
|
|
418
418
|
members: {
|
|
419
419
|
cache: Map<any, any>;
|
|
420
|
-
fetch: import("vitest").Mock<
|
|
420
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
421
421
|
};
|
|
422
422
|
roles: {
|
|
423
423
|
cache: Map<any, any>;
|
|
424
424
|
};
|
|
425
425
|
};
|
|
426
|
-
isTextBased: import("vitest").Mock<
|
|
427
|
-
isDMBased: import("vitest").Mock<
|
|
426
|
+
isTextBased: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
427
|
+
isDMBased: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
428
428
|
nsfw: boolean;
|
|
429
|
-
send: import("vitest").Mock<
|
|
430
|
-
permissionsFor: import("vitest").Mock<
|
|
429
|
+
send: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
430
|
+
permissionsFor: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
431
431
|
};
|
|
432
432
|
member: {
|
|
433
433
|
id: string;
|
|
@@ -441,18 +441,18 @@ export declare function createMockStringSelectMenuInteraction(overrides?: Record
|
|
|
441
441
|
ownerId: string;
|
|
442
442
|
channels: {
|
|
443
443
|
cache: Map<any, any>;
|
|
444
|
-
fetch: import("vitest").Mock<
|
|
444
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
445
445
|
};
|
|
446
446
|
members: {
|
|
447
447
|
cache: Map<any, any>;
|
|
448
|
-
fetch: import("vitest").Mock<
|
|
448
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
449
449
|
};
|
|
450
450
|
roles: {
|
|
451
451
|
cache: Map<any, any>;
|
|
452
452
|
};
|
|
453
453
|
};
|
|
454
454
|
permissions: {
|
|
455
|
-
has: import("vitest").Mock<
|
|
455
|
+
has: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
456
456
|
};
|
|
457
457
|
roles: {
|
|
458
458
|
cache: Map<any, any>;
|
|
@@ -462,17 +462,17 @@ export declare function createMockStringSelectMenuInteraction(overrides?: Record
|
|
|
462
462
|
id: string;
|
|
463
463
|
username: string;
|
|
464
464
|
};
|
|
465
|
-
reply: import("vitest").Mock<
|
|
466
|
-
deferReply: import("vitest").Mock<
|
|
467
|
-
deferUpdate: import("vitest").Mock<
|
|
468
|
-
update: import("vitest").Mock<
|
|
465
|
+
reply: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
466
|
+
deferReply: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
467
|
+
deferUpdate: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
468
|
+
update: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
469
469
|
};
|
|
470
470
|
export declare function createMockModalSubmitInteraction(overrides?: Record<string, any>): {
|
|
471
471
|
id: string;
|
|
472
472
|
customId: string;
|
|
473
473
|
fields: {
|
|
474
|
-
getTextInputValue: import("vitest").Mock<
|
|
475
|
-
getField: import("vitest").Mock<
|
|
474
|
+
getTextInputValue: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
475
|
+
getField: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
476
476
|
fields: any[];
|
|
477
477
|
};
|
|
478
478
|
guild: {
|
|
@@ -481,11 +481,11 @@ export declare function createMockModalSubmitInteraction(overrides?: Record<stri
|
|
|
481
481
|
ownerId: string;
|
|
482
482
|
channels: {
|
|
483
483
|
cache: Map<any, any>;
|
|
484
|
-
fetch: import("vitest").Mock<
|
|
484
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
485
485
|
};
|
|
486
486
|
members: {
|
|
487
487
|
cache: Map<any, any>;
|
|
488
|
-
fetch: import("vitest").Mock<
|
|
488
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
489
489
|
};
|
|
490
490
|
roles: {
|
|
491
491
|
cache: Map<any, any>;
|
|
@@ -502,21 +502,21 @@ export declare function createMockModalSubmitInteraction(overrides?: Record<stri
|
|
|
502
502
|
ownerId: string;
|
|
503
503
|
channels: {
|
|
504
504
|
cache: Map<any, any>;
|
|
505
|
-
fetch: import("vitest").Mock<
|
|
505
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
506
506
|
};
|
|
507
507
|
members: {
|
|
508
508
|
cache: Map<any, any>;
|
|
509
|
-
fetch: import("vitest").Mock<
|
|
509
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
510
510
|
};
|
|
511
511
|
roles: {
|
|
512
512
|
cache: Map<any, any>;
|
|
513
513
|
};
|
|
514
514
|
};
|
|
515
|
-
isTextBased: import("vitest").Mock<
|
|
516
|
-
isDMBased: import("vitest").Mock<
|
|
515
|
+
isTextBased: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
516
|
+
isDMBased: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
517
517
|
nsfw: boolean;
|
|
518
|
-
send: import("vitest").Mock<
|
|
519
|
-
permissionsFor: import("vitest").Mock<
|
|
518
|
+
send: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
519
|
+
permissionsFor: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
520
520
|
};
|
|
521
521
|
member: {
|
|
522
522
|
id: string;
|
|
@@ -530,18 +530,18 @@ export declare function createMockModalSubmitInteraction(overrides?: Record<stri
|
|
|
530
530
|
ownerId: string;
|
|
531
531
|
channels: {
|
|
532
532
|
cache: Map<any, any>;
|
|
533
|
-
fetch: import("vitest").Mock<
|
|
533
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
534
534
|
};
|
|
535
535
|
members: {
|
|
536
536
|
cache: Map<any, any>;
|
|
537
|
-
fetch: import("vitest").Mock<
|
|
537
|
+
fetch: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
538
538
|
};
|
|
539
539
|
roles: {
|
|
540
540
|
cache: Map<any, any>;
|
|
541
541
|
};
|
|
542
542
|
};
|
|
543
543
|
permissions: {
|
|
544
|
-
has: import("vitest").Mock<
|
|
544
|
+
has: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
545
545
|
};
|
|
546
546
|
roles: {
|
|
547
547
|
cache: Map<any, any>;
|
|
@@ -551,7 +551,7 @@ export declare function createMockModalSubmitInteraction(overrides?: Record<stri
|
|
|
551
551
|
id: string;
|
|
552
552
|
username: string;
|
|
553
553
|
};
|
|
554
|
-
reply: import("vitest").Mock<
|
|
555
|
-
deferReply: import("vitest").Mock<
|
|
556
|
-
deferUpdate: import("vitest").Mock<
|
|
554
|
+
reply: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
555
|
+
deferReply: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
556
|
+
deferUpdate: import("vitest").Mock<import("@vitest/spy").Procedure>;
|
|
557
557
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zumito-framework",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.0",
|
|
4
4
|
"description": "Discord.js bot framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"author": "ZumitoTeam",
|
|
24
24
|
"license": "ISC",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@discordjs/rest": "^
|
|
26
|
+
"@discordjs/rest": "^2.6.1",
|
|
27
27
|
"@types/express": "^4.17.13",
|
|
28
28
|
"autocorrect": "^1.2.0",
|
|
29
29
|
"better-logging": "^5.0.0",
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
"zumito-db": "^2.0.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@types/node": "^
|
|
48
|
+
"@types/node": "^22.0.0",
|
|
49
49
|
"@typescript-eslint/eslint-plugin": "^5.48.2",
|
|
50
50
|
"@typescript-eslint/parser": "^5.48.2",
|
|
51
|
-
"@vitest/coverage-v8": "^1.
|
|
51
|
+
"@vitest/coverage-v8": "^4.1.9",
|
|
52
52
|
"eslint": "^8.32.0",
|
|
53
53
|
"eslint-config-prettier": "^8.6.0",
|
|
54
54
|
"eslint-plugin-check-file": "^2.2.0",
|
|
55
55
|
"eslint-plugin-prettier": "^4.2.1",
|
|
56
56
|
"prettier": "^2.8.3",
|
|
57
57
|
"typescript": "^5.8.3",
|
|
58
|
-
"vitest": "^1.
|
|
58
|
+
"vitest": "^4.1.9"
|
|
59
59
|
},
|
|
60
60
|
"type": "module",
|
|
61
61
|
"exports": {
|