reciple 6.0.4 → 7.0.0-dev.11
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/LICENSE +674 -674
- package/README.md +193 -182
- package/bin/bin.d.mts +2 -0
- package/bin/bin.mjs +73 -0
- package/bin/bin.mjs.map +1 -0
- package/bin/classes/Config.d.ts +32 -0
- package/bin/classes/Config.js +72 -0
- package/bin/classes/Config.js.map +1 -0
- package/bin/esm.d.mts +1 -0
- package/{dist/lib → bin}/esm.mjs +0 -0
- package/bin/esm.mjs.map +1 -0
- package/bin/exports.d.ts +4 -0
- package/bin/exports.js +21 -0
- package/bin/exports.js.map +1 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +19 -0
- package/bin/index.js.map +1 -0
- package/bin/utils/cli.d.ts +4 -0
- package/bin/utils/cli.js +20 -0
- package/bin/utils/cli.js.map +1 -0
- package/bin/utils/logger.d.ts +6 -0
- package/bin/utils/logger.js +61 -0
- package/bin/utils/logger.js.map +1 -0
- package/bin/utils/modules.d.ts +3 -0
- package/bin/utils/modules.js +35 -0
- package/bin/utils/modules.js.map +1 -0
- package/package.json +26 -66
- package/static/config.yml +97 -0
- package/dist/lib/bin.mjs +0 -77
- package/dist/lib/bin.mjs.map +0 -1
- package/dist/lib/esm.mjs.map +0 -1
- package/dist/lib/index.js +0 -34
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/reciple/classes/RecipleClient.js +0 -293
- package/dist/lib/reciple/classes/RecipleClient.js.map +0 -1
- package/dist/lib/reciple/classes/RecipleConfig.js +0 -107
- package/dist/lib/reciple/classes/RecipleConfig.js.map +0 -1
- package/dist/lib/reciple/classes/RecipleModule.js +0 -137
- package/dist/lib/reciple/classes/RecipleModule.js.map +0 -1
- package/dist/lib/reciple/classes/builders/MessageCommandBuilder.js +0 -316
- package/dist/lib/reciple/classes/builders/MessageCommandBuilder.js.map +0 -1
- package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js +0 -127
- package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js.map +0 -1
- package/dist/lib/reciple/classes/builders/SlashCommandBuilder.js +0 -253
- package/dist/lib/reciple/classes/builders/SlashCommandBuilder.js.map +0 -1
- package/dist/lib/reciple/classes/managers/ApplicationCommandManager.js +0 -179
- package/dist/lib/reciple/classes/managers/ApplicationCommandManager.js.map +0 -1
- package/dist/lib/reciple/classes/managers/CommandCooldownManager.js +0 -100
- package/dist/lib/reciple/classes/managers/CommandCooldownManager.js.map +0 -1
- package/dist/lib/reciple/classes/managers/CommandManager.js +0 -65
- package/dist/lib/reciple/classes/managers/CommandManager.js.map +0 -1
- package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js +0 -26
- package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js.map +0 -1
- package/dist/lib/reciple/classes/managers/ModuleManager.js +0 -181
- package/dist/lib/reciple/classes/managers/ModuleManager.js.map +0 -1
- package/dist/lib/reciple/flags.js +0 -32
- package/dist/lib/reciple/flags.js.map +0 -1
- package/dist/lib/reciple/permissions.js +0 -31
- package/dist/lib/reciple/permissions.js.map +0 -1
- package/dist/lib/reciple/types/builders.js +0 -12
- package/dist/lib/reciple/types/builders.js.map +0 -1
- package/dist/lib/reciple/types/commands.js +0 -16
- package/dist/lib/reciple/types/commands.js.map +0 -1
- package/dist/lib/reciple/types/paramOptions.js +0 -3
- package/dist/lib/reciple/types/paramOptions.js.map +0 -1
- package/dist/lib/reciple/util.js +0 -72
- package/dist/lib/reciple/util.js.map +0 -1
- package/dist/lib/reciple/version.js +0 -48
- package/dist/lib/reciple/version.js.map +0 -1
- package/dist/types/bin.d.mts +0 -3
- package/dist/types/bin.d.mts.map +0 -1
- package/dist/types/esm.d.mts +0 -2
- package/dist/types/esm.d.mts.map +0 -1
- package/dist/types/index.d.ts +0 -18
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/reciple/classes/RecipleClient.d.ts +0 -116
- package/dist/types/reciple/classes/RecipleClient.d.ts.map +0 -1
- package/dist/types/reciple/classes/RecipleConfig.d.ts +0 -102
- package/dist/types/reciple/classes/RecipleConfig.d.ts.map +0 -1
- package/dist/types/reciple/classes/RecipleModule.d.ts +0 -88
- package/dist/types/reciple/classes/RecipleModule.d.ts.map +0 -1
- package/dist/types/reciple/classes/builders/MessageCommandBuilder.d.ts +0 -198
- package/dist/types/reciple/classes/builders/MessageCommandBuilder.d.ts.map +0 -1
- package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts +0 -54
- package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts.map +0 -1
- package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts +0 -107
- package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts.map +0 -1
- package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts +0 -54
- package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts.map +0 -1
- package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts +0 -71
- package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts.map +0 -1
- package/dist/types/reciple/classes/managers/CommandManager.d.ts +0 -35
- package/dist/types/reciple/classes/managers/CommandManager.d.ts.map +0 -1
- package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts +0 -23
- package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts.map +0 -1
- package/dist/types/reciple/classes/managers/ModuleManager.d.ts +0 -50
- package/dist/types/reciple/classes/managers/ModuleManager.d.ts.map +0 -1
- package/dist/types/reciple/flags.d.ts +0 -18
- package/dist/types/reciple/flags.d.ts.map +0 -1
- package/dist/types/reciple/permissions.d.ts +0 -16
- package/dist/types/reciple/permissions.d.ts.map +0 -1
- package/dist/types/reciple/types/builders.d.ts +0 -206
- package/dist/types/reciple/types/builders.d.ts.map +0 -1
- package/dist/types/reciple/types/commands.d.ts +0 -86
- package/dist/types/reciple/types/commands.d.ts.map +0 -1
- package/dist/types/reciple/types/paramOptions.d.ts +0 -102
- package/dist/types/reciple/types/paramOptions.d.ts.map +0 -1
- package/dist/types/reciple/util.d.ts +0 -27
- package/dist/types/reciple/util.d.ts.map +0 -1
- package/dist/types/reciple/version.d.ts +0 -26
- package/dist/types/reciple/version.d.ts.map +0 -1
- package/resource/reciple.yml +0 -122
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MessageCommandOptionManager = void 0;
|
|
4
|
-
const discord_js_1 = require("discord.js");
|
|
5
|
-
/**
|
|
6
|
-
* Validated message options manager
|
|
7
|
-
*/
|
|
8
|
-
class MessageCommandOptionManager extends Array {
|
|
9
|
-
constructor(...data) {
|
|
10
|
-
super(...(0, discord_js_1.normalizeArray)(data));
|
|
11
|
-
}
|
|
12
|
-
get(name, required) {
|
|
13
|
-
const option = this.find(o => o.name == name);
|
|
14
|
-
if (!option?.value == undefined && required)
|
|
15
|
-
throw new TypeError(`Can't find option named ${name}`);
|
|
16
|
-
return option ?? null;
|
|
17
|
-
}
|
|
18
|
-
getValue(name, requied) {
|
|
19
|
-
const option = this.get(name, requied);
|
|
20
|
-
if (!option?.value && requied)
|
|
21
|
-
throw new TypeError(`Value of option named ${name} is undefined`);
|
|
22
|
-
return option?.value ?? null;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.MessageCommandOptionManager = MessageCommandOptionManager;
|
|
26
|
-
//# sourceMappingURL=MessageCommandOptionManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MessageCommandOptionManager.js","sourceRoot":"","sources":["../../../../../src/reciple/classes/managers/MessageCommandOptionManager.ts"],"names":[],"mappings":";;;AACA,2CAAyD;AAEzD;;GAEG;AACH,MAAa,2BAA4B,SAAQ,KAAoC;IACjF,YAAY,GAAG,IAAgD;QAC3D,KAAK,CAAC,GAAG,IAAA,2BAAc,EAAC,IAAI,CAAC,CAAC,CAAC;IACnC,CAAC;IASM,GAAG,CAAC,IAAY,EAAE,QAAkB;QACvC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,SAAS,IAAI,QAAQ;YAAE,MAAM,IAAI,SAAS,CAAC,2BAA2B,IAAI,EAAE,CAAC,CAAC;QAEpG,OAAO,MAAM,IAAI,IAAI,CAAC;IAC1B,CAAC;IASM,QAAQ,CAAC,IAAY,EAAE,OAAiB;QAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,OAAO;YAAE,MAAM,IAAI,SAAS,CAAC,yBAAyB,IAAI,eAAe,CAAC,CAAC;QAEjG,OAAO,MAAM,EAAE,KAAK,IAAI,IAAI,CAAC;IACjC,CAAC;CACJ;AAhCD,kEAgCC"}
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ModuleManager = void 0;
|
|
4
|
-
const discord_js_1 = require("discord.js");
|
|
5
|
-
const fs_1 = require("fs");
|
|
6
|
-
const RecipleModule_1 = require("../RecipleModule");
|
|
7
|
-
const version_1 = require("../../version");
|
|
8
|
-
const micromatch_1 = require("micromatch");
|
|
9
|
-
const util_1 = require("../../util");
|
|
10
|
-
const util_2 = require("util");
|
|
11
|
-
class ModuleManager {
|
|
12
|
-
constructor(options) {
|
|
13
|
-
this.modules = new discord_js_1.Collection();
|
|
14
|
-
this.client = options.client;
|
|
15
|
-
options.modules?.forEach(m => (m instanceof RecipleModule_1.RecipleModule ? m : new RecipleModule_1.RecipleModule({ client: this.client, script: m })));
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Start modules
|
|
19
|
-
* @param options start modules options
|
|
20
|
-
* @returns started modules
|
|
21
|
-
*/
|
|
22
|
-
async startModules(options) {
|
|
23
|
-
const startedModules = [];
|
|
24
|
-
for (const module_ of options.modules) {
|
|
25
|
-
if (!this.client.isClientLogsSilent)
|
|
26
|
-
this.client.logger.log(`Starting module '${module_}'`);
|
|
27
|
-
try {
|
|
28
|
-
let error;
|
|
29
|
-
const start = await module_.start().catch(err => {
|
|
30
|
-
error = err;
|
|
31
|
-
return false;
|
|
32
|
-
});
|
|
33
|
-
if (error)
|
|
34
|
-
throw new Error(`An error occured while loading module '${module_}': \n${(0, util_2.inspect)(error)}`);
|
|
35
|
-
if (!start) {
|
|
36
|
-
if (!this.client.isClientLogsSilent)
|
|
37
|
-
this.client.logger.error(`Module '${module_}' returned false onStart`);
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
if (options.addToModulesCollection !== false)
|
|
41
|
-
this.modules.set(module_.id, module_);
|
|
42
|
-
startedModules.push(module_);
|
|
43
|
-
}
|
|
44
|
-
catch (err) {
|
|
45
|
-
if (options?.ignoreErrors === false)
|
|
46
|
-
throw err;
|
|
47
|
-
if (!this.client.isClientLogsSilent)
|
|
48
|
-
this.client.logger.error(`Failed to start module '${module_}': `, err);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return startedModules;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Load modules
|
|
55
|
-
* @param options load modules options
|
|
56
|
-
* @returns failed load modules
|
|
57
|
-
*/
|
|
58
|
-
async loadModules(options) {
|
|
59
|
-
const failedToLoadModules = [];
|
|
60
|
-
for (const module_ of options?.modules ?? this.modules.toJSON()) {
|
|
61
|
-
try {
|
|
62
|
-
await module_.load().catch(err => {
|
|
63
|
-
throw err;
|
|
64
|
-
});
|
|
65
|
-
if (options?.resolveCommands !== false) {
|
|
66
|
-
module_.resolveCommands();
|
|
67
|
-
this.client.commands.add(module_.commands);
|
|
68
|
-
}
|
|
69
|
-
if (!this.client.isClientLogsSilent)
|
|
70
|
-
this.client.logger.log(`Loaded module '${module_}'`);
|
|
71
|
-
}
|
|
72
|
-
catch (err) {
|
|
73
|
-
if (options?.ignoreErrors === false)
|
|
74
|
-
throw err;
|
|
75
|
-
if (!this.client.isClientLogsSilent)
|
|
76
|
-
this.client.logger.error(`Failed to load module '${module_}': `, err);
|
|
77
|
-
failedToLoadModules.push(module_);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return failedToLoadModules;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Unload modules
|
|
84
|
-
* @param options unload modules options
|
|
85
|
-
* @returns unloaded modules
|
|
86
|
-
*/
|
|
87
|
-
async unloadModules(options) {
|
|
88
|
-
const unloadedModules = [];
|
|
89
|
-
for (const module_ of options?.modules ?? this.modules.toJSON()) {
|
|
90
|
-
try {
|
|
91
|
-
await module_.unload().catch(err => {
|
|
92
|
-
throw err;
|
|
93
|
-
});
|
|
94
|
-
unloadedModules.push(module_);
|
|
95
|
-
if (!this.client.isClientLogsSilent)
|
|
96
|
-
this.client.logger.log(`Unloaded module '${module_}'`);
|
|
97
|
-
}
|
|
98
|
-
catch (err) {
|
|
99
|
-
if (options?.ignoreErrors === false)
|
|
100
|
-
throw err;
|
|
101
|
-
if (!this.client.isClientLogsSilent)
|
|
102
|
-
this.client.logger.error(`Failed to unLoad module '${module_}': `, err);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return unloadedModules;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Resolve modules from file paths
|
|
109
|
-
* @param options resolve module files options
|
|
110
|
-
* @returns resolved modules
|
|
111
|
-
*/
|
|
112
|
-
async resolveModuleFiles(options) {
|
|
113
|
-
const modules = [];
|
|
114
|
-
for (const file of options.files) {
|
|
115
|
-
try {
|
|
116
|
-
const resolveFile = await import((util_1.path.isAbsolute(file) ? 'file://' : '') + file);
|
|
117
|
-
const script = resolveFile instanceof RecipleModule_1.RecipleModule || ModuleManager.validateScript(resolveFile) ? resolveFile : resolveFile?.default?.default instanceof RecipleModule_1.RecipleModule || ModuleManager.validateScript(resolveFile?.default?.default) ? resolveFile.default.default : resolveFile?.default;
|
|
118
|
-
if (script instanceof RecipleModule_1.RecipleModule) {
|
|
119
|
-
modules.push(script);
|
|
120
|
-
continue;
|
|
121
|
-
}
|
|
122
|
-
if (!ModuleManager.validateScript(script))
|
|
123
|
-
throw new Error(`Invalid module script: ${file}`);
|
|
124
|
-
if (!this.client.config.disableVersionCheck && !(0, discord_js_1.normalizeArray)([script.versions])?.some(v => (0, version_1.isSupportedVersion)(v, this.client.version))) {
|
|
125
|
-
throw new Error(`Unsupported module: ${file}`);
|
|
126
|
-
}
|
|
127
|
-
modules.push(new RecipleModule_1.RecipleModule({
|
|
128
|
-
client: this.client,
|
|
129
|
-
script,
|
|
130
|
-
filePath: file,
|
|
131
|
-
}));
|
|
132
|
-
}
|
|
133
|
-
catch (err) {
|
|
134
|
-
if (options.ignoreErrors === false)
|
|
135
|
-
throw err;
|
|
136
|
-
if (!this.client.isClientLogsSilent)
|
|
137
|
-
this.client.logger.error(`Can't resolve module from: ${file}`, err);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return modules;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Validate module script
|
|
144
|
-
* @param script module script
|
|
145
|
-
* @returns `true` if script is valid
|
|
146
|
-
*/
|
|
147
|
-
static validateScript(script) {
|
|
148
|
-
const s = script;
|
|
149
|
-
if (typeof s !== 'object')
|
|
150
|
-
return false;
|
|
151
|
-
if (typeof s.versions !== 'string' && !Array.isArray(s.versions))
|
|
152
|
-
return false;
|
|
153
|
-
if (typeof s.onStart !== 'function')
|
|
154
|
-
return false;
|
|
155
|
-
if (s.onLoad && typeof s.onLoad !== 'function')
|
|
156
|
-
return false;
|
|
157
|
-
if (s.onUnload && typeof s.onUnload !== 'function')
|
|
158
|
-
return false;
|
|
159
|
-
return true;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Get module file paths from folders
|
|
163
|
-
* @param options get module paths options
|
|
164
|
-
* @returns module paths
|
|
165
|
-
*/
|
|
166
|
-
async getModulePaths(options) {
|
|
167
|
-
const modules = [];
|
|
168
|
-
for (const dir of options?.folders ?? (0, discord_js_1.normalizeArray)([this.client.config.modulesFolder])) {
|
|
169
|
-
if (!(0, fs_1.existsSync)(dir))
|
|
170
|
-
(0, fs_1.mkdirSync)(dir, { recursive: true });
|
|
171
|
-
if (!(0, fs_1.lstatSync)(dir).isDirectory())
|
|
172
|
-
continue;
|
|
173
|
-
modules.push(...(0, fs_1.readdirSync)(dir)
|
|
174
|
-
.map(file => util_1.path.join(!dir.startsWith('/') ? this.client.cwd : '', dir, file))
|
|
175
|
-
.filter(file => (options?.filter ? options.filter(file) : file.endsWith('.js'))));
|
|
176
|
-
}
|
|
177
|
-
return modules.filter(file => !(0, micromatch_1.isMatch)(util_1.path.basename(file), options?.ignoredFiles ?? this.client.config.ignoredFiles));
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
exports.ModuleManager = ModuleManager;
|
|
181
|
-
//# sourceMappingURL=ModuleManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleManager.js","sourceRoot":"","sources":["../../../../../src/reciple/classes/managers/ModuleManager.ts"],"names":[],"mappings":";;;AACA,2CAAqE;AACrE,2BAAmE;AACnE,oDAAgE;AAChE,2CAAmD;AAEnD,2CAAqC;AACrC,qCAAkC;AAClC,+BAA+B;AAO/B,MAAa,aAAa;IAItB,YAAY,OAA6B;QAFhC,YAAO,GAAsC,IAAI,uBAAU,EAAE,CAAC;QAGnE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAE7B,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,6BAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,6BAAa,CAAC,EAAE,MAAM,EAA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,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CACvF,CAAC;SACL;QAED,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAA,oBAAO,EAAC,WAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;IAC3H,CAAC;CACJ;AAxLD,sCAwLC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cwd = exports.token = exports.flags = exports.commander = void 0;
|
|
4
|
-
const version_js_1 = require("./version.js");
|
|
5
|
-
const commander_1 = require("commander");
|
|
6
|
-
/**
|
|
7
|
-
* Commander
|
|
8
|
-
*/
|
|
9
|
-
exports.commander = new commander_1.Command()
|
|
10
|
-
.name('reciple')
|
|
11
|
-
.description('Reciple.js - Discord.js handler cli')
|
|
12
|
-
.version(`v${version_js_1.rawVersion}`, '-v, --version')
|
|
13
|
-
.argument('[current-working-directory]', 'Change the current working directory')
|
|
14
|
-
.option('-t, --token <token>', 'Replace used bot token')
|
|
15
|
-
.option('-c, --config <config>', 'Change path to config file')
|
|
16
|
-
.option('-D, --debugmode', 'Enable debug mode')
|
|
17
|
-
.option('-y, --yes', 'Automatically agree to Reciple confirmation prompts')
|
|
18
|
-
.option('-v, --version', 'Display version')
|
|
19
|
-
.parse();
|
|
20
|
-
/**
|
|
21
|
-
* Used commander flags
|
|
22
|
-
*/
|
|
23
|
-
exports.flags = exports.commander.opts();
|
|
24
|
-
/**
|
|
25
|
-
* Token flag
|
|
26
|
-
*/
|
|
27
|
-
exports.token = exports.flags.token;
|
|
28
|
-
/**
|
|
29
|
-
* Current working directory
|
|
30
|
-
*/
|
|
31
|
-
exports.cwd = exports.commander.args[0] || process.cwd();
|
|
32
|
-
//# sourceMappingURL=flags.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../../src/reciple/flags.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,yCAAoC;AAEpC;;GAEG;AACU,QAAA,SAAS,GAAG,IAAI,mBAAO,EAAE;KACjC,IAAI,CAAC,SAAS,CAAC;KACf,WAAW,CAAC,qCAAqC,CAAC;KAClD,OAAO,CAAC,IAAI,uBAAU,EAAE,EAAE,eAAe,CAAC;KAC1C,QAAQ,CAAC,6BAA6B,EAAE,sCAAsC,CAAC;KAC/E,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC;KACvD,MAAM,CAAC,uBAAuB,EAAE,4BAA4B,CAAC;KAC7D,MAAM,CAAC,iBAAiB,EAAE,mBAAmB,CAAC;KAC9C,MAAM,CAAC,WAAW,EAAE,qDAAqD,CAAC;KAC1E,MAAM,CAAC,eAAe,EAAE,iBAAiB,CAAC;KAC1C,KAAK,EAAE,CAAC;AAEb;;GAEG;AACU,QAAA,KAAK,GAAG,iBAAS,CAAC,IAAI,EAAE,CAAC;AAEtC;;GAEG;AACU,QAAA,KAAK,GAAuB,aAAK,CAAC,KAAK,CAAC;AAErD;;GAEG;AACU,QAAA,GAAG,GAAG,iBAAS,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.botHasExecutePermissions = exports.userHasCommandPermissions = void 0;
|
|
4
|
-
const discord_js_1 = require("discord.js");
|
|
5
|
-
/**
|
|
6
|
-
* Check if the user has permissions to execute the given command name
|
|
7
|
-
* @param options options
|
|
8
|
-
*/
|
|
9
|
-
function userHasCommandPermissions(options) {
|
|
10
|
-
const command = (options.commandPermissions?.enabled ? options.commandPermissions?.commands.find(c => c.command.toLowerCase() === options.builder.name.toLowerCase()) : null) ?? {
|
|
11
|
-
permissions: options.builder.requiredMemberPermissions,
|
|
12
|
-
};
|
|
13
|
-
if (!command.permissions.length)
|
|
14
|
-
return true;
|
|
15
|
-
return options.memberPermissions ? options.memberPermissions.has(command.permissions) : false;
|
|
16
|
-
}
|
|
17
|
-
exports.userHasCommandPermissions = userHasCommandPermissions;
|
|
18
|
-
function botHasExecutePermissions(guildOrChannel, requiredPermissions) {
|
|
19
|
-
if (!requiredPermissions?.length)
|
|
20
|
-
return true;
|
|
21
|
-
let permissions = null;
|
|
22
|
-
if (guildOrChannel instanceof discord_js_1.Guild) {
|
|
23
|
-
permissions = guildOrChannel.members.me?.permissions ?? null;
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
permissions = guildOrChannel?.permissionsFor(guildOrChannel.client.user.id) ?? null;
|
|
27
|
-
}
|
|
28
|
-
return permissions ? permissions.has(requiredPermissions) : false;
|
|
29
|
-
}
|
|
30
|
-
exports.botHasExecutePermissions = botHasExecutePermissions;
|
|
31
|
-
//# sourceMappingURL=permissions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../../src/reciple/permissions.ts"],"names":[],"mappings":";;;AAAA,2CAAqG;AAGrG;;;GAGG;AACH,SAAgB,yBAAyB,CAAC,OAAyC;IAC/E,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI;QAC7K,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,yBAAyB;KACzD,CAAC;IACF,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAE7C,OAAO,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAClG,CAAC;AAPD,8DAOC;AAUD,SAAgB,wBAAwB,CAAC,cAA8C,EAAE,mBAA4C;IACjI,IAAI,CAAC,mBAAmB,EAAE,MAAM;QAAE,OAAO,IAAI,CAAC;IAE9C,IAAI,WAAW,GAA+B,IAAI,CAAC;IAEnD,IAAI,cAAc,YAAY,kBAAK,EAAE;QACjC,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,WAAW,IAAI,IAAI,CAAC;KAChE;SAAM;QACH,WAAW,GAAG,cAAc,EAAE,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;KACvF;IAED,OAAO,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACtE,CAAC;AAZD,4DAYC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CommandType = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Types of command builders
|
|
6
|
-
*/
|
|
7
|
-
var CommandType;
|
|
8
|
-
(function (CommandType) {
|
|
9
|
-
CommandType[CommandType["SlashCommand"] = 1] = "SlashCommand";
|
|
10
|
-
CommandType[CommandType["MessageCommand"] = 2] = "MessageCommand";
|
|
11
|
-
})(CommandType = exports.CommandType || (exports.CommandType = {}));
|
|
12
|
-
//# sourceMappingURL=builders.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"builders.js","sourceRoot":"","sources":["../../../../src/reciple/types/builders.ts"],"names":[],"mappings":";;;AAoHA;;GAEG;AACH,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,6DAAgB,CAAA;IAChB,iEAAc,CAAA;AAClB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CommandHaltReason = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Command halt reasons
|
|
6
|
-
*/
|
|
7
|
-
var CommandHaltReason;
|
|
8
|
-
(function (CommandHaltReason) {
|
|
9
|
-
CommandHaltReason[CommandHaltReason["Error"] = 1] = "Error";
|
|
10
|
-
CommandHaltReason[CommandHaltReason["Cooldown"] = 2] = "Cooldown";
|
|
11
|
-
CommandHaltReason[CommandHaltReason["InvalidArguments"] = 3] = "InvalidArguments";
|
|
12
|
-
CommandHaltReason[CommandHaltReason["MissingArguments"] = 4] = "MissingArguments";
|
|
13
|
-
CommandHaltReason[CommandHaltReason["MissingMemberPermissions"] = 5] = "MissingMemberPermissions";
|
|
14
|
-
CommandHaltReason[CommandHaltReason["MissingBotPermissions"] = 6] = "MissingBotPermissions";
|
|
15
|
-
})(CommandHaltReason = exports.CommandHaltReason || (exports.CommandHaltReason = {}));
|
|
16
|
-
//# sourceMappingURL=commands.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../../src/reciple/types/commands.ts"],"names":[],"mappings":";;;AA2FA;;GAEG;AACH,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IACzB,2DAAS,CAAA;IACT,iEAAQ,CAAA;IACR,iFAAgB,CAAA;IAChB,iFAAgB,CAAA;IAChB,iGAAwB,CAAA;IACxB,2FAAqB,CAAA;AACzB,CAAC,EAPW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAO5B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paramOptions.js","sourceRoot":"","sources":["../../../../src/reciple/types/paramOptions.ts"],"names":[],"mappings":""}
|
package/dist/lib/reciple/util.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.path = exports.createLogger = exports.validateCommandBuilder = exports.deprecationWarning = exports.isClass = void 0;
|
|
7
|
-
const fallout_utility_1 = require("fallout-utility");
|
|
8
|
-
const builders_1 = require("./types/builders");
|
|
9
|
-
const flags_1 = require("./flags");
|
|
10
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
11
|
-
const path_1 = __importDefault(require("path"));
|
|
12
|
-
/**
|
|
13
|
-
* Check if an object is a class
|
|
14
|
-
* @param object Object to identify
|
|
15
|
-
*/
|
|
16
|
-
function isClass(object) {
|
|
17
|
-
const isClassConstructor = object.constructor && object.constructor.toString().substring(0, 5) === 'class';
|
|
18
|
-
if (object.prototype === undefined)
|
|
19
|
-
return isClassConstructor;
|
|
20
|
-
const isPrototypeClassConstructor = object.prototype.constructor && object.prototype.constructor.toString && object.prototype.constructor.toString().substring(0, 5) === 'class';
|
|
21
|
-
return isClassConstructor || isPrototypeClassConstructor;
|
|
22
|
-
}
|
|
23
|
-
exports.isClass = isClass;
|
|
24
|
-
/**
|
|
25
|
-
* Emit process warning about deprecated method/function
|
|
26
|
-
* @param content Warning content
|
|
27
|
-
*/
|
|
28
|
-
function deprecationWarning(content) {
|
|
29
|
-
process.emitWarning(content, 'DeprecationWarning');
|
|
30
|
-
}
|
|
31
|
-
exports.deprecationWarning = deprecationWarning;
|
|
32
|
-
function validateCommandBuilder(command) {
|
|
33
|
-
if (!command.name)
|
|
34
|
-
return false;
|
|
35
|
-
if (command.type === builders_1.CommandType.MessageCommand && command.options.length && command.options.some(o => !o.name))
|
|
36
|
-
return false;
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
exports.validateCommandBuilder = validateCommandBuilder;
|
|
40
|
-
/**
|
|
41
|
-
* Create new logger
|
|
42
|
-
* @param stringifyJSON stringify json objects in console
|
|
43
|
-
* @param debugmode display debug messages
|
|
44
|
-
* @param colorizeMessage add logger colours to messages
|
|
45
|
-
*/
|
|
46
|
-
function createLogger(stringifyJSON, debugmode = false, colorizeMessage = true) {
|
|
47
|
-
return new fallout_utility_1.Logger({
|
|
48
|
-
stringifyJSON: stringifyJSON,
|
|
49
|
-
enableDebugMode: flags_1.flags.debugmode ?? debugmode,
|
|
50
|
-
loggerName: 'Main',
|
|
51
|
-
prefixes: {
|
|
52
|
-
[fallout_utility_1.LogLevels.INFO]: (name) => `[${new Date().toLocaleTimeString(undefined, { hour12: false })}][${(name ? name + '/' : '') + 'INFO'}]`,
|
|
53
|
-
[fallout_utility_1.LogLevels.WARN]: (name) => `[${chalk_1.default.yellow(new Date().toLocaleTimeString(undefined, { hour12: false }))}][${chalk_1.default.yellow((name ? name + '/' : '') + 'WARN')}]`,
|
|
54
|
-
[fallout_utility_1.LogLevels.ERROR]: (name) => `[${chalk_1.default.red(new Date().toLocaleTimeString(undefined, { hour12: false }))}][${chalk_1.default.red((name ? name + '/' : '') + 'ERROR')}]`,
|
|
55
|
-
[fallout_utility_1.LogLevels.DEBUG]: (name) => `[${chalk_1.default.blue(new Date().toLocaleTimeString(undefined, { hour12: false }))}][${chalk_1.default.blue((name ? name + '/' : '') + 'DEBUG')}]`,
|
|
56
|
-
},
|
|
57
|
-
formatMessages: {
|
|
58
|
-
[fallout_utility_1.LogLevels.INFO]: (message) => message,
|
|
59
|
-
[fallout_utility_1.LogLevels.WARN]: (message) => (!colorizeMessage ? message : chalk_1.default.yellow(message)),
|
|
60
|
-
[fallout_utility_1.LogLevels.ERROR]: (message) => (!colorizeMessage ? message : chalk_1.default.red(message)),
|
|
61
|
-
[fallout_utility_1.LogLevels.DEBUG]: (message) => (!colorizeMessage ? message : chalk_1.default.blue(message)),
|
|
62
|
-
},
|
|
63
|
-
ObjectInspectDepth: 3,
|
|
64
|
-
ObjectInspectColorized: colorizeMessage,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
exports.createLogger = createLogger;
|
|
68
|
-
/**
|
|
69
|
-
* Path module that depending on os
|
|
70
|
-
*/
|
|
71
|
-
exports.path = (0, fallout_utility_1.getOperatingSystem)() === fallout_utility_1.OS.WINDOWS ? path_1.default.win32 : path_1.default.posix;
|
|
72
|
-
//# sourceMappingURL=util.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/reciple/util.ts"],"names":[],"mappings":";;;;;;AAAA,qDAA4E;AAC5E,+CAAkE;AAClE,mCAAgC;AAChC,kDAA0B;AAC1B,gDAAyB;AAEzB;;;GAGG;AACH,SAAgB,OAAO,CAAI,MAAW;IAClC,MAAM,kBAAkB,GAAG,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC;IAC3G,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS;QAAE,OAAO,kBAAkB,CAAC;IAE9D,MAAM,2BAA2B,GAAG,MAAM,CAAC,SAAS,CAAC,WAAW,IAAI,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC;IACjL,OAAO,kBAAkB,IAAI,2BAA2B,CAAC;AAC7D,CAAC;AAND,0BAMC;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AAK,CAAC,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,eAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAC7F;QACD,kBAAkB,EAAE,CAAC;QACrB,sBAAsB,EAAE,eAAe;KAC1C,CAAC,CAAC;AACP,CAAC;AApBD,oCAoBC;AAED;;GAEG;AACU,QAAA,IAAI,GAAuB,IAAA,oCAAkB,GAAE,KAAK,oBAAE,CAAC,OAAO,CAAC,CAAC,CAAC,cAAK,CAAC,KAAK,CAAC,CAAC,CAAC,cAAK,CAAC,KAAK,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isSupportedVersion = exports.parseVersion = exports.isValidVersion = exports.rawVersion = exports.version = void 0;
|
|
7
|
-
const semver_1 = __importDefault(require("semver"));
|
|
8
|
-
/**
|
|
9
|
-
* Current reciple version
|
|
10
|
-
*/
|
|
11
|
-
exports.version = `${semver_1.default.coerce(require('../../../package.json').version)}`;
|
|
12
|
-
/**
|
|
13
|
-
* Current reciple version from package.json
|
|
14
|
-
*/
|
|
15
|
-
exports.rawVersion = require('../../../package.json').version;
|
|
16
|
-
/**
|
|
17
|
-
* Check if the version is valid
|
|
18
|
-
* @param ver Version string to validated
|
|
19
|
-
*/
|
|
20
|
-
function isValidVersion(ver) {
|
|
21
|
-
return semver_1.default.valid(semver_1.default.coerce(ver)) !== null;
|
|
22
|
-
}
|
|
23
|
-
exports.isValidVersion = isValidVersion;
|
|
24
|
-
/**
|
|
25
|
-
* Parse the version string
|
|
26
|
-
* @param ver Parse version string
|
|
27
|
-
*/
|
|
28
|
-
function parseVersion(ver) {
|
|
29
|
-
if (!isValidVersion(ver))
|
|
30
|
-
throw new TypeError(`Invalid version: ${ver}`);
|
|
31
|
-
return semver_1.default.parse(ver);
|
|
32
|
-
}
|
|
33
|
-
exports.parseVersion = parseVersion;
|
|
34
|
-
/**
|
|
35
|
-
* Check if the given version is supported by the given version range
|
|
36
|
-
* @param versionRange Version range
|
|
37
|
-
* @param supportedVersion Version to match given version range
|
|
38
|
-
*/
|
|
39
|
-
function isSupportedVersion(versionRange, supportedVersion) {
|
|
40
|
-
supportedVersion = supportedVersion || exports.version;
|
|
41
|
-
if (!isValidVersion(versionRange))
|
|
42
|
-
throw new TypeError(`Invalid version: ${versionRange}`);
|
|
43
|
-
if (!isValidVersion(supportedVersion))
|
|
44
|
-
throw new TypeError(`Invalid supported version: ${supportedVersion}`);
|
|
45
|
-
return semver_1.default.satisfies(supportedVersion, versionRange);
|
|
46
|
-
}
|
|
47
|
-
exports.isSupportedVersion = isSupportedVersion;
|
|
48
|
-
//# sourceMappingURL=version.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/reciple/version.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B;;GAEG;AACU,QAAA,OAAO,GAAG,GAAG,gBAAM,CAAC,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;AAEpF;;GAEG;AACU,QAAA,UAAU,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC,OAAO,CAAC;AAEnE;;;GAGG;AACH,SAAgB,cAAc,CAAC,GAAW;IACtC,OAAO,gBAAM,CAAC,KAAK,CAAC,gBAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC;AACrD,CAAC;AAFD,wCAEC;AAED;;;GAGG;AACH,SAAgB,YAAY,CAAC,GAAW;IACpC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,oBAAoB,GAAG,EAAE,CAAC,CAAC;IAEzE,OAAO,gBAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC;AAJD,oCAIC;AACD;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,YAAoB,EAAE,gBAAyB;IAC9E,gBAAgB,GAAG,gBAAgB,IAAI,eAAO,CAAC;IAE/C,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,oBAAoB,YAAY,EAAE,CAAC,CAAC;IAC3F,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,8BAA8B,gBAAgB,EAAE,CAAC,CAAC;IAE7G,OAAO,gBAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAC5D,CAAC;AAPD,gDAOC"}
|
package/dist/types/bin.d.mts
DELETED
package/dist/types/bin.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bin.d.mts","sourceRoot":"","sources":["../../src/bin.mts"],"names":[],"mappings":";AAYA,OAAO,eAAe,CAAC"}
|
package/dist/types/esm.d.mts
DELETED
package/dist/types/esm.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"esm.d.mts","sourceRoot":"","sources":["../../src/esm.mts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export * from './reciple/classes/builders/MessageCommandBuilder.js';
|
|
2
|
-
export * from './reciple/classes/builders/MessageCommandOptionBuilder.js';
|
|
3
|
-
export * from './reciple/classes/builders/SlashCommandBuilder.js';
|
|
4
|
-
export * from './reciple/classes/managers/ApplicationCommandManager.js';
|
|
5
|
-
export * from './reciple/classes/managers/CommandCooldownManager.js';
|
|
6
|
-
export * from './reciple/classes/managers/CommandManager.js';
|
|
7
|
-
export * from './reciple/classes/managers/MessageCommandOptionManager.js';
|
|
8
|
-
export * from './reciple/classes/managers/ModuleManager.js';
|
|
9
|
-
export * from './reciple/classes/RecipleClient.js';
|
|
10
|
-
export * from './reciple/classes/RecipleConfig.js';
|
|
11
|
-
export * from './reciple/classes/RecipleModule.js';
|
|
12
|
-
export * from './reciple/types/builders.js';
|
|
13
|
-
export * from './reciple/types/commands.js';
|
|
14
|
-
export * from './reciple/flags';
|
|
15
|
-
export * from './reciple/permissions.js';
|
|
16
|
-
export * from './reciple/util.js';
|
|
17
|
-
export * from './reciple/version.js';
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qDAAqD,CAAC;AACpE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,mDAAmD,CAAC;AAClE,cAAc,yDAAyD,CAAC;AACxE,cAAc,sDAAsD,CAAC;AACrE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,2DAA2D,CAAC;AAC1E,cAAc,6CAA6C,CAAC;AAC5D,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { Awaitable, ChatInputCommandInteraction, Client, ClientEvents, ClientOptions, Interaction, Message } from 'discord.js';
|
|
2
|
-
import { MessageCommandBuilder, MessageCommandExecuteData, MessageCommandHaltData } from './builders/MessageCommandBuilder';
|
|
3
|
-
import { SlashCommandExecuteData, SlashCommandHaltData } from './builders/SlashCommandBuilder';
|
|
4
|
-
import { AnyCommandExecuteData, AnyCommandHaltData } from '../types/commands';
|
|
5
|
-
import { CommandCooldownManager } from './managers/CommandCooldownManager';
|
|
6
|
-
import { AnySlashCommandBuilder } from '../types/builders';
|
|
7
|
-
import { ApplicationCommandManager } from './managers/ApplicationCommandManager';
|
|
8
|
-
import { CommandManager } from './managers/CommandManager';
|
|
9
|
-
import { ModuleManager } from './managers/ModuleManager';
|
|
10
|
-
import { Config } from './RecipleConfig';
|
|
11
|
-
import { Logger } from 'fallout-utility';
|
|
12
|
-
/**
|
|
13
|
-
* Options for {@link RecipleClient}
|
|
14
|
-
*/
|
|
15
|
-
export interface RecipleClientOptions extends ClientOptions {
|
|
16
|
-
config?: Config;
|
|
17
|
-
cwd?: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Reciple client events
|
|
21
|
-
*/
|
|
22
|
-
export interface RecipleClientEvents extends ClientEvents {
|
|
23
|
-
recipleCommandExecute: [executeData: AnyCommandExecuteData];
|
|
24
|
-
recipleCommandHalt: [haltData: AnyCommandHaltData];
|
|
25
|
-
recipleRegisterApplicationCommands: [];
|
|
26
|
-
recipleReplyError: [error: unknown];
|
|
27
|
-
}
|
|
28
|
-
export declare enum RecipleEvents {
|
|
29
|
-
RecipleCommandExecute = "recipleCommandExecute",
|
|
30
|
-
RecipleCommandHalt = "recipleCommandHalt",
|
|
31
|
-
RecipleRegisterApplicationCommands = "recipleRegisterApplicationCommands",
|
|
32
|
-
RecipleReplyError = "recipleReplyError",
|
|
33
|
-
CommandExecute = "recipleCommandExecute",
|
|
34
|
-
CommandHalt = "recipleCommandHalt",
|
|
35
|
-
RegisterApplicationCommands = "recipleRegisterApplicationCommands",
|
|
36
|
-
ReplyError = "recipleReplyError"
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Reciple client
|
|
40
|
-
*/
|
|
41
|
-
export interface RecipleClient<Ready extends boolean = boolean> extends Client<Ready> {
|
|
42
|
-
on<E extends keyof RecipleClientEvents>(event: E, listener: (...args: RecipleClientEvents[E]) => Awaitable<void>): this;
|
|
43
|
-
on<E extends string | symbol>(event: E, listener: (...args: any) => Awaitable<void>): this;
|
|
44
|
-
once<E extends keyof RecipleClientEvents>(event: E, listener: (...args: RecipleClientEvents[E]) => Awaitable<void>): this;
|
|
45
|
-
once<E extends keyof string | symbol>(event: E, listener: (...args: any) => Awaitable<void>): this;
|
|
46
|
-
emit<E extends keyof RecipleClientEvents>(event: E, ...args: RecipleClientEvents[E]): boolean;
|
|
47
|
-
emit<E extends string | symbol>(event: E, ...args: any): boolean;
|
|
48
|
-
off<E extends keyof RecipleClientEvents>(event: E, listener: (...args: RecipleClientEvents[E]) => Awaitable<void>): this;
|
|
49
|
-
off<E extends string | symbol>(event: E, listener: (...args: any) => Awaitable<void>): this;
|
|
50
|
-
removeAllListeners<E extends keyof RecipleClientEvents>(event?: E): this;
|
|
51
|
-
removeAllListeners(event?: string | symbol): this;
|
|
52
|
-
isReady(): this is RecipleClient<true>;
|
|
53
|
-
}
|
|
54
|
-
export declare class RecipleClient<Ready extends boolean = boolean> extends Client<Ready> {
|
|
55
|
-
readonly config: Config;
|
|
56
|
-
readonly commands: CommandManager;
|
|
57
|
-
readonly applicationCommands: ApplicationCommandManager;
|
|
58
|
-
readonly cooldowns: CommandCooldownManager;
|
|
59
|
-
readonly modules: ModuleManager;
|
|
60
|
-
readonly cwd: string;
|
|
61
|
-
readonly logger: Logger;
|
|
62
|
-
readonly version: string;
|
|
63
|
-
get isClientLogsSilent(): boolean;
|
|
64
|
-
/**
|
|
65
|
-
* @param options Client options
|
|
66
|
-
*/
|
|
67
|
-
constructor(options: RecipleClientOptions);
|
|
68
|
-
/**
|
|
69
|
-
* Listed to command executions
|
|
70
|
-
* @deprecated Not useful
|
|
71
|
-
*/
|
|
72
|
-
addCommandListeners(): RecipleClient<Ready>;
|
|
73
|
-
/**
|
|
74
|
-
* Execute a slash command
|
|
75
|
-
* @param interaction Slash command interaction
|
|
76
|
-
*/
|
|
77
|
-
slashCommandExecute(interaction: Interaction | ChatInputCommandInteraction): Promise<undefined | SlashCommandExecuteData>;
|
|
78
|
-
/**
|
|
79
|
-
* Execute a Message command
|
|
80
|
-
* @param message Message command executor
|
|
81
|
-
* @param prefix Message command prefix
|
|
82
|
-
*/
|
|
83
|
-
messageCommandExecute(message: Message, prefix?: string): Promise<undefined | MessageCommandExecuteData>;
|
|
84
|
-
/**
|
|
85
|
-
* Get a message from config
|
|
86
|
-
* @param messageKey Config messages key
|
|
87
|
-
* @param defaultMessage Default message when the key does not exists
|
|
88
|
-
*/
|
|
89
|
-
getConfigMessage<T = unknown>(messageKey: string, defaultMessage?: T): T;
|
|
90
|
-
/**
|
|
91
|
-
* Emits the {@link RecipleClientEvents["recipleReplyError"]} event
|
|
92
|
-
* @param error Received Error
|
|
93
|
-
*/
|
|
94
|
-
protected _replyError(error: unknown): void;
|
|
95
|
-
/**
|
|
96
|
-
* Executes command halt function
|
|
97
|
-
* @param command Halted command's builder
|
|
98
|
-
* @param haltData Halted command's data
|
|
99
|
-
*/
|
|
100
|
-
protected _haltCommand(command: AnySlashCommandBuilder, haltData: SlashCommandHaltData): Promise<boolean>;
|
|
101
|
-
protected _haltCommand(command: MessageCommandBuilder, haltData: MessageCommandHaltData): Promise<boolean>;
|
|
102
|
-
/**
|
|
103
|
-
* Executes a command's {@link SharedCommandBuilderProperties["execute"]} method
|
|
104
|
-
* @param command Command builder
|
|
105
|
-
* @param executeData Command execute data
|
|
106
|
-
*/
|
|
107
|
-
protected _executeCommand(command: AnySlashCommandBuilder, executeData: SlashCommandExecuteData): Promise<SlashCommandExecuteData | undefined>;
|
|
108
|
-
protected _executeCommand(command: MessageCommandBuilder, executeData: MessageCommandExecuteData): Promise<MessageCommandExecuteData | undefined>;
|
|
109
|
-
/**
|
|
110
|
-
* Error message when a command fails to execute
|
|
111
|
-
* @param err Received error
|
|
112
|
-
* @param command Slash/Message command execute data
|
|
113
|
-
*/
|
|
114
|
-
protected _commandExecuteError(err: Error, command: AnyCommandExecuteData): Promise<void>;
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=RecipleClient.d.ts.map
|