reciple 6.0.3 → 7.0.0-dev.5
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/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/index.d.ts +5 -0
- package/bin/index.js +22 -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 +25 -67
- package/static/config.yml +97 -0
- package/README.md +0 -182
- 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,107 +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.RecipleConfig = void 0;
|
|
7
|
-
const fs_1 = require("fs");
|
|
8
|
-
const version_1 = require("../version");
|
|
9
|
-
const fallout_utility_1 = require("fallout-utility");
|
|
10
|
-
const flags_1 = require("../flags");
|
|
11
|
-
const util_1 = require("../util");
|
|
12
|
-
const yaml_1 = __importDefault(require("yaml"));
|
|
13
|
-
/**
|
|
14
|
-
* Create/parse reciple config
|
|
15
|
-
*/
|
|
16
|
-
class RecipleConfig {
|
|
17
|
-
/**
|
|
18
|
-
* @param configPath Path to config
|
|
19
|
-
*/
|
|
20
|
-
constructor(configPath) {
|
|
21
|
-
this.config = RecipleConfig.getDefaultConfig();
|
|
22
|
-
this.configPath = util_1.path.join(process.cwd(), 'reciple.yml');
|
|
23
|
-
if (!configPath)
|
|
24
|
-
throw new Error('Config path is not defined');
|
|
25
|
-
this.configPath = configPath;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Parse the config file
|
|
29
|
-
*/
|
|
30
|
-
parseConfig() {
|
|
31
|
-
if (!(0, fs_1.existsSync)(this.configPath)) {
|
|
32
|
-
const defaultConfigPath = RecipleConfig.defaultConfigPath;
|
|
33
|
-
if (!(0, fs_1.existsSync)(defaultConfigPath))
|
|
34
|
-
throw new Error('Default Config file not found. Please reinstall Reciple.');
|
|
35
|
-
const defaultConfig = (0, fallout_utility_1.replaceAll)((0, fs_1.readFileSync)(defaultConfigPath, 'utf-8'), 'VERSION', version_1.version);
|
|
36
|
-
(0, fs_1.writeFileSync)(this.configPath, defaultConfig, 'utf-8');
|
|
37
|
-
if (!(0, fs_1.existsSync)(this.configPath))
|
|
38
|
-
throw new Error('Failed to create config file.');
|
|
39
|
-
this.config = yaml_1.default.parse(defaultConfig);
|
|
40
|
-
if (this.config && this.config.token === 'TOKEN') {
|
|
41
|
-
this.config.token = this._askToken() || this.config.token;
|
|
42
|
-
(0, fs_1.writeFileSync)(this.configPath, (0, fallout_utility_1.replaceAll)(defaultConfig, ' TOKEN', ` ${this.config.token}`), 'utf-8');
|
|
43
|
-
}
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
if (!(0, fs_1.existsSync)(this.configPath))
|
|
47
|
-
throw new Error('Failed to read config file.');
|
|
48
|
-
const config = (0, fs_1.readFileSync)(this.configPath, 'utf-8');
|
|
49
|
-
this.config = yaml_1.default.parse(config);
|
|
50
|
-
if (!this._isSupportedConfig())
|
|
51
|
-
throw new Error('Unsupported config version. Your config version: ' + (this.config?.version || 'No version specified.') + ', Reciple version: ' + version_1.version);
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Returns the parsed config file
|
|
56
|
-
*/
|
|
57
|
-
getConfig() {
|
|
58
|
-
if (!this.config)
|
|
59
|
-
throw new Error('Config is not parsed.');
|
|
60
|
-
this.config.token = this.parseToken() || 'TOKEN';
|
|
61
|
-
return this.config;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Parse token from config
|
|
65
|
-
* @param askIfEmpty Ask for token if the token is undefined
|
|
66
|
-
*/
|
|
67
|
-
parseToken(askIfEmpty = true) {
|
|
68
|
-
let token = flags_1.token || this.config?.token || undefined;
|
|
69
|
-
if (!token)
|
|
70
|
-
return token || (askIfEmpty ? this._askToken() : null);
|
|
71
|
-
const envToken = token.toString().split(':');
|
|
72
|
-
if (envToken.length === 2 && envToken[0].toLocaleLowerCase() === 'env' && envToken[1]) {
|
|
73
|
-
token = process.env[envToken[1]] || undefined;
|
|
74
|
-
}
|
|
75
|
-
return token || (askIfEmpty == null ? this._askToken() : null);
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Check if the config version is supported
|
|
79
|
-
*/
|
|
80
|
-
_isSupportedConfig() {
|
|
81
|
-
return (0, version_1.isSupportedVersion)(this.config?.version || '0.0.0', version_1.version);
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Ask for a token
|
|
85
|
-
*/
|
|
86
|
-
_askToken() {
|
|
87
|
-
return (flags_1.token ||
|
|
88
|
-
(0, fallout_utility_1.input)({
|
|
89
|
-
text: 'Bot Token >>> ',
|
|
90
|
-
echo: '*',
|
|
91
|
-
repeatIfEmpty: true,
|
|
92
|
-
sigint: true,
|
|
93
|
-
}) ||
|
|
94
|
-
null);
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Get default config
|
|
98
|
-
*/
|
|
99
|
-
static getDefaultConfig() {
|
|
100
|
-
if (!(0, fs_1.existsSync)(this.defaultConfigPath))
|
|
101
|
-
throw new Error(`Default config file does not exists: ${this.defaultConfigPath}`);
|
|
102
|
-
return yaml_1.default.parse((0, fs_1.readFileSync)(this.defaultConfigPath, 'utf-8'));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
exports.RecipleConfig = RecipleConfig;
|
|
106
|
-
RecipleConfig.defaultConfigPath = util_1.path.join(__dirname, '../../../../resource/reciple.yml');
|
|
107
|
-
//# sourceMappingURL=RecipleConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RecipleConfig.js","sourceRoot":"","sources":["../../../../src/reciple/classes/RecipleConfig.ts"],"names":[],"mappings":";;;;;;AACA,2BAA6D;AAC7D,wCAAyD;AACzD,qDAAoD;AACpD,oCAA4C;AAC5C,kCAA+B;AAC/B,gDAAwB;AAmExB;;GAEG;AACH,MAAa,aAAa;IAKtB;;OAEG;IACH,YAAY,UAAkB;QAPvB,WAAM,GAAW,aAAa,CAAC,gBAAgB,EAAE,CAAC;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AQ,CAAC,CAAC,CAAC,EAAE;YACnF,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC;SACjD;QAED,OAAO,KAAK,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACO,kBAAkB;QACxB,OAAO,IAAA,4BAAkB,EAAC,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI,OAAO,EAAE,iBAAO,CAAC,CAAC;IACxE,CAAC;IAED;;OAEG;IACO,SAAS;QACf,OAAO,CACH,aAAO;YACP,IAAA,uBAAK,EAAC;gBACF,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,GAAG;gBACT,aAAa,EAAE,IAAI;gBACnB,MAAM,EAAE,IAAI;aACf,CAAC;YACF,IAAI,CACP,CAAC;IACN,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,gBAAgB;QAC1B,IAAI,CAAC,IAAA,eAAU,EAAC,IAAI,CAAC,iBAAiB,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAE3H,OAAO,cAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC;IACrE,CAAC;;AArGL,sCAsGC;AAnGiB,+BAAiB,GAAG,WAAI,CAAC,IAAI,CAAC,SAAS,EAAE,kCAAkC,CAAC,CAAC"}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RecipleModule = void 0;
|
|
4
|
-
const builders_1 = require("../types/builders");
|
|
5
|
-
const discord_js_1 = require("discord.js");
|
|
6
|
-
const MessageCommandBuilder_1 = require("./builders/MessageCommandBuilder");
|
|
7
|
-
const SlashCommandBuilder_1 = require("./builders/SlashCommandBuilder");
|
|
8
|
-
const util_1 = require("../util");
|
|
9
|
-
const version_1 = require("../version");
|
|
10
|
-
const crypto_1 = require("crypto");
|
|
11
|
-
class RecipleModule {
|
|
12
|
-
get versions() {
|
|
13
|
-
return this.script.versions;
|
|
14
|
-
}
|
|
15
|
-
get onStart() {
|
|
16
|
-
return this.script.onStart;
|
|
17
|
-
}
|
|
18
|
-
get onLoad() {
|
|
19
|
-
return this.script.onLoad;
|
|
20
|
-
}
|
|
21
|
-
get onUnload() {
|
|
22
|
-
return this.script.onUnload;
|
|
23
|
-
}
|
|
24
|
-
get displayName() {
|
|
25
|
-
return this.filePath ?? this.id;
|
|
26
|
-
}
|
|
27
|
-
get isSupported() {
|
|
28
|
-
return (0, discord_js_1.normalizeArray)([this.versions]).some(v => (0, version_1.isSupportedVersion)(v, this.client.version));
|
|
29
|
-
}
|
|
30
|
-
constructor(options) {
|
|
31
|
-
this.commands = [];
|
|
32
|
-
this.id = (0, crypto_1.randomUUID)();
|
|
33
|
-
this.client = options.client;
|
|
34
|
-
this.script = options.script;
|
|
35
|
-
this.filePath = options.filePath;
|
|
36
|
-
this.metadata = options.metadata;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Execute module's {@link RecipleScript.onStart}
|
|
40
|
-
*/
|
|
41
|
-
async start() {
|
|
42
|
-
return Promise.resolve(this.script.onStart(this.client));
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Execute module's {@link RecipleScript.onLoad}
|
|
46
|
-
* @param resolveCommands Parse commands
|
|
47
|
-
*/
|
|
48
|
-
async load(resolveCommands = true) {
|
|
49
|
-
if (typeof this.script.onLoad === 'function')
|
|
50
|
-
await this.script.onLoad(this.client);
|
|
51
|
-
if (resolveCommands)
|
|
52
|
-
this.resolveCommands();
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Execute module's {@link RecipleScript.onUnload}
|
|
56
|
-
* @param reason Unload reason
|
|
57
|
-
*/
|
|
58
|
-
async unload(reason) {
|
|
59
|
-
if (typeof this.script.onUnload === 'function')
|
|
60
|
-
await this.script.onUnload(reason, this.client);
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Register application commands from this module
|
|
64
|
-
* @param guilds Register to certain guilds
|
|
65
|
-
*/
|
|
66
|
-
async registerSlashCommands(...guilds) {
|
|
67
|
-
for (const command of this.commands) {
|
|
68
|
-
if (command.type !== builders_1.CommandType.SlashCommand)
|
|
69
|
-
continue;
|
|
70
|
-
await this.client.applicationCommands.add(command, (0, discord_js_1.normalizeArray)(guilds));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Unregister application commands from this module
|
|
75
|
-
* @param guilds Unregister from certain guilds
|
|
76
|
-
*/
|
|
77
|
-
async unregisterSlashCommands(...guilds) {
|
|
78
|
-
for (const builder of this.commands) {
|
|
79
|
-
if (builder.type !== builders_1.CommandType.SlashCommand)
|
|
80
|
-
continue;
|
|
81
|
-
if ((0, discord_js_1.normalizeArray)(guilds).length) {
|
|
82
|
-
for (const guild of (0, discord_js_1.normalizeArray)(guilds)) {
|
|
83
|
-
const command = this.client.applicationCommands.get(builder, guild);
|
|
84
|
-
if (command)
|
|
85
|
-
await this.client.applicationCommands.remove(command, guild);
|
|
86
|
-
}
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
const command = this.client.applicationCommands.get(builder);
|
|
90
|
-
if (command)
|
|
91
|
-
await this.client.applicationCommands.remove(command);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Update registered application commands of this module
|
|
96
|
-
* @param guilds update commands from certain guilds
|
|
97
|
-
*/
|
|
98
|
-
async updateSlashCommands(...guilds) {
|
|
99
|
-
for (const builder of this.commands) {
|
|
100
|
-
if (builder.type !== builders_1.CommandType.SlashCommand)
|
|
101
|
-
continue;
|
|
102
|
-
if ((0, discord_js_1.normalizeArray)(guilds).length) {
|
|
103
|
-
for (const guild of (0, discord_js_1.normalizeArray)(guilds)) {
|
|
104
|
-
const command = this.client.applicationCommands.get(builder, guild);
|
|
105
|
-
if (command)
|
|
106
|
-
await this.client.applicationCommands.edit(command, builder, guild);
|
|
107
|
-
}
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
const command = this.client.applicationCommands.get(builder);
|
|
111
|
-
if (command)
|
|
112
|
-
await this.client.applicationCommands.edit(command, builder);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Resolve module commands
|
|
117
|
-
*/
|
|
118
|
-
resolveCommands() {
|
|
119
|
-
if (!Array.isArray(this.script?.commands))
|
|
120
|
-
return this.commands;
|
|
121
|
-
for (const command of this.script.commands) {
|
|
122
|
-
if (command?.type !== builders_1.CommandType.SlashCommand && command?.type !== builders_1.CommandType.MessageCommand)
|
|
123
|
-
continue;
|
|
124
|
-
const builder = command.type === builders_1.CommandType.SlashCommand ? SlashCommandBuilder_1.SlashCommandBuilder.resolveSlashCommand(command) : MessageCommandBuilder_1.MessageCommandBuilder.resolveMessageCommand(command);
|
|
125
|
-
if (!(0, util_1.validateCommandBuilder)(builder))
|
|
126
|
-
throw new Error('Invalid command builder, no name or contains option(s) without name');
|
|
127
|
-
this.commands.push(builder);
|
|
128
|
-
}
|
|
129
|
-
this.client.commands.add(this.commands);
|
|
130
|
-
return this.commands;
|
|
131
|
-
}
|
|
132
|
-
toString() {
|
|
133
|
-
return this.displayName;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
exports.RecipleModule = RecipleModule;
|
|
137
|
-
//# sourceMappingURL=RecipleModule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RecipleModule.js","sourceRoot":"","sources":["../../../../src/reciple/classes/RecipleModule.ts"],"names":[],"mappings":";;;AAAA,gDAAmF;AACnF,2CAA0E;AAC1E,4EAAyE;AACzE,wEAAqE;AACr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AM,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;YACxC,IAAI,OAAO,EAAE,IAAI,KAAK,sBAAW,CAAC,YAAY,IAAI,OAAO,EAAE,IAAI,KAAK,sBAAW,CAAC,cAAc;gBAAE,SAAS;YAEzG,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,KAAK,sBAAW,CAAC,YAAY,CAAC,CAAC,CAAC,yCAAmB,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,6CAAqB,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;YAEpK,IAAI,CAAC,IAAA,6BAAsB,EAAC,OAAO,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;YAC7H,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAC/B;QAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAEM,QAAQ;QACX,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;CACJ;AAhJD,sCAgJC"}
|
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MessageCommandBuilder = void 0;
|
|
4
|
-
const builders_1 = require("../../types/builders");
|
|
5
|
-
const discord_js_1 = require("discord.js");
|
|
6
|
-
const MessageCommandOptionManager_1 = require("../managers/MessageCommandOptionManager");
|
|
7
|
-
const MessageCommandOptionBuilder_1 = require("./MessageCommandOptionBuilder");
|
|
8
|
-
/**
|
|
9
|
-
* Reciple builder for message command
|
|
10
|
-
*/
|
|
11
|
-
class MessageCommandBuilder {
|
|
12
|
-
get name() {
|
|
13
|
-
return this._name;
|
|
14
|
-
}
|
|
15
|
-
get description() {
|
|
16
|
-
return this._description;
|
|
17
|
-
}
|
|
18
|
-
get cooldown() {
|
|
19
|
-
return this._cooldown;
|
|
20
|
-
}
|
|
21
|
-
get aliases() {
|
|
22
|
-
return this._aliases;
|
|
23
|
-
}
|
|
24
|
-
get validateOptions() {
|
|
25
|
-
return this._validateOptions;
|
|
26
|
-
}
|
|
27
|
-
get options() {
|
|
28
|
-
return this._options;
|
|
29
|
-
}
|
|
30
|
-
get requiredBotPermissions() {
|
|
31
|
-
return this._requiredBotPermissions;
|
|
32
|
-
}
|
|
33
|
-
get requiredMemberPermissions() {
|
|
34
|
-
return this._requiredMemberPermissions;
|
|
35
|
-
}
|
|
36
|
-
get allowExecuteInDM() {
|
|
37
|
-
return this._allowExecuteInDM;
|
|
38
|
-
}
|
|
39
|
-
get allowExecuteByBots() {
|
|
40
|
-
return this._allowExecuteByBots;
|
|
41
|
-
}
|
|
42
|
-
get halt() {
|
|
43
|
-
return this._halt;
|
|
44
|
-
}
|
|
45
|
-
get execute() {
|
|
46
|
-
return this._execute;
|
|
47
|
-
}
|
|
48
|
-
set name(name) {
|
|
49
|
-
this.setName(name);
|
|
50
|
-
}
|
|
51
|
-
set description(description) {
|
|
52
|
-
this.setDescription(description);
|
|
53
|
-
}
|
|
54
|
-
set cooldown(cooldown) {
|
|
55
|
-
this.setCooldown(cooldown);
|
|
56
|
-
}
|
|
57
|
-
set aliases(aliases) {
|
|
58
|
-
this.addAliases(aliases);
|
|
59
|
-
}
|
|
60
|
-
set validateOptions(validate) {
|
|
61
|
-
this.setValidateOptions(validate);
|
|
62
|
-
}
|
|
63
|
-
set options(options) {
|
|
64
|
-
this.setOptions(options);
|
|
65
|
-
}
|
|
66
|
-
set requiredBotPermissions(permissions) {
|
|
67
|
-
this.setRequiredBotPermissions(permissions);
|
|
68
|
-
}
|
|
69
|
-
set requiredMemberPermissions(permissions) {
|
|
70
|
-
this.setRequiredMemberPermissions(permissions);
|
|
71
|
-
}
|
|
72
|
-
set allowExecuteInDM(allow) {
|
|
73
|
-
this.setAllowExecuteInDM(allow);
|
|
74
|
-
}
|
|
75
|
-
set allowExecuteByBots(allow) {
|
|
76
|
-
this.setAllowExecuteByBots(allow);
|
|
77
|
-
}
|
|
78
|
-
set halt(halt) {
|
|
79
|
-
this.setHalt(halt);
|
|
80
|
-
}
|
|
81
|
-
set execute(execute) {
|
|
82
|
-
this.setExecute(execute);
|
|
83
|
-
}
|
|
84
|
-
constructor(data) {
|
|
85
|
-
this.type = builders_1.CommandType.MessageCommand;
|
|
86
|
-
this._name = '';
|
|
87
|
-
this._description = '';
|
|
88
|
-
this._cooldown = 0;
|
|
89
|
-
this._aliases = [];
|
|
90
|
-
this._validateOptions = false;
|
|
91
|
-
this._options = [];
|
|
92
|
-
this._requiredBotPermissions = [];
|
|
93
|
-
this._requiredMemberPermissions = [];
|
|
94
|
-
this._allowExecuteInDM = true;
|
|
95
|
-
this._allowExecuteByBots = false;
|
|
96
|
-
this._execute = () => {
|
|
97
|
-
/* Execute */
|
|
98
|
-
};
|
|
99
|
-
if (data?.name !== undefined)
|
|
100
|
-
this.setName(data.name);
|
|
101
|
-
if (data?.description !== undefined)
|
|
102
|
-
this.setDescription(data.description);
|
|
103
|
-
if (data?.aliases !== undefined)
|
|
104
|
-
this.addAliases(data.aliases);
|
|
105
|
-
if (data?.cooldown !== undefined)
|
|
106
|
-
this.setCooldown(Number(data?.cooldown));
|
|
107
|
-
if (data?.requiredBotPermissions !== undefined)
|
|
108
|
-
this.setRequiredBotPermissions(data.requiredBotPermissions);
|
|
109
|
-
if (data?.requiredMemberPermissions !== undefined)
|
|
110
|
-
this.setRequiredMemberPermissions(data.requiredMemberPermissions);
|
|
111
|
-
if (data?.halt !== undefined)
|
|
112
|
-
this.setHalt(data.halt);
|
|
113
|
-
if (data?.execute !== undefined)
|
|
114
|
-
this.setExecute(data.execute);
|
|
115
|
-
if (data?.metadata !== undefined)
|
|
116
|
-
this.setMetadata(data.metadata);
|
|
117
|
-
if (data?.allowExecuteByBots !== undefined)
|
|
118
|
-
this.setAllowExecuteByBots(true);
|
|
119
|
-
if (data?.allowExecuteInDM !== undefined)
|
|
120
|
-
this.setAllowExecuteInDM(true);
|
|
121
|
-
if (data?.validateOptions !== undefined)
|
|
122
|
-
this.setValidateOptions(true);
|
|
123
|
-
if (data?.options !== undefined)
|
|
124
|
-
this.options = data.options.map(o => (o instanceof MessageCommandOptionBuilder_1.MessageCommandOptionBuilder ? o : new MessageCommandOptionBuilder_1.MessageCommandOptionBuilder(o)));
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Sets the command name
|
|
128
|
-
* @param name Command name
|
|
129
|
-
*/
|
|
130
|
-
setName(name) {
|
|
131
|
-
if ((0, discord_js_1.isValidationEnabled)() && (!name || typeof name !== 'string' || !name.match(/^[\w-]{1,32}$/)))
|
|
132
|
-
throw new TypeError('name must be a string and match the regex /^[\\w-]{1,32}$/');
|
|
133
|
-
this._name = name;
|
|
134
|
-
return this;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Sets the command description
|
|
138
|
-
* @param description Command description
|
|
139
|
-
*/
|
|
140
|
-
setDescription(description) {
|
|
141
|
-
if ((0, discord_js_1.isValidationEnabled)() && (!description || typeof description !== 'string'))
|
|
142
|
-
throw new TypeError('description must be a string.');
|
|
143
|
-
this._description = description;
|
|
144
|
-
return this;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Add aliases to the command
|
|
148
|
-
* @param aliases Command aliases
|
|
149
|
-
*/
|
|
150
|
-
addAliases(...aliases) {
|
|
151
|
-
aliases = (0, discord_js_1.normalizeArray)(aliases);
|
|
152
|
-
if (!aliases.length)
|
|
153
|
-
throw new TypeError('Provide atleast one alias');
|
|
154
|
-
if (aliases.some(a => !a || typeof a !== 'string' || a.match(/^\s+$/)))
|
|
155
|
-
throw new TypeError('aliases must be strings and should not contain whitespaces');
|
|
156
|
-
if (this.name && aliases.some(a => a == this.name))
|
|
157
|
-
throw new TypeError('alias cannot have same name to its real command name');
|
|
158
|
-
this._aliases = [...new Set(aliases.map(s => s.toLowerCase()))];
|
|
159
|
-
return this;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Replace aliases from command builder
|
|
163
|
-
* @param aliases Command aliases
|
|
164
|
-
*/
|
|
165
|
-
setAliases(...aliases) {
|
|
166
|
-
this._aliases = [];
|
|
167
|
-
return this.addAliases(...aliases);
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Set if command can be executed in dms
|
|
171
|
-
* @param allowExecuteInDM `true` if the command can execute in DMs
|
|
172
|
-
*/
|
|
173
|
-
setAllowExecuteInDM(allowExecuteInDM) {
|
|
174
|
-
this._allowExecuteInDM = !!allowExecuteInDM;
|
|
175
|
-
return this;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Allow command to be executed by bots
|
|
179
|
-
* @param allowExecuteByBots `true` if the command can be executed by bots
|
|
180
|
-
*/
|
|
181
|
-
setAllowExecuteByBots(allowExecuteByBots) {
|
|
182
|
-
this._allowExecuteByBots = !!allowExecuteByBots;
|
|
183
|
-
return this;
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Add new command options
|
|
187
|
-
* @param options Message options
|
|
188
|
-
*/
|
|
189
|
-
addOptions(...options) {
|
|
190
|
-
for (const optionResolvable of (0, discord_js_1.normalizeArray)(options)) {
|
|
191
|
-
const option = typeof optionResolvable === 'function' ? optionResolvable(new MessageCommandOptionBuilder_1.MessageCommandOptionBuilder()) : optionResolvable instanceof MessageCommandOptionBuilder_1.MessageCommandOptionBuilder ? optionResolvable : MessageCommandOptionBuilder_1.MessageCommandOptionBuilder.resolveMessageCommandOption(optionResolvable);
|
|
192
|
-
if ((0, discord_js_1.isValidationEnabled)()) {
|
|
193
|
-
if (this.options.find(o => o.name === option.name))
|
|
194
|
-
throw new TypeError('option with name "' + option.name + '" already exists.');
|
|
195
|
-
if (this.options.length > 0 && !this.options[this.options.length - 1 < 0 ? 0 : this.options.length - 1].required && option.required)
|
|
196
|
-
throw new TypeError('All required options must be before optional options.');
|
|
197
|
-
}
|
|
198
|
-
this._options.push(option);
|
|
199
|
-
}
|
|
200
|
-
return this;
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Add new command option
|
|
204
|
-
* @param option Message option
|
|
205
|
-
*/
|
|
206
|
-
addOption(option) {
|
|
207
|
-
return this.addOptions(option);
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Set options from command
|
|
211
|
-
* @params options Message options
|
|
212
|
-
*/
|
|
213
|
-
setOptions(...options) {
|
|
214
|
-
this._options = [];
|
|
215
|
-
return this.addOptions(...options);
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Validate options before executing
|
|
219
|
-
* @param validateOptions `true` if the command options needs to be validated before executing
|
|
220
|
-
*/
|
|
221
|
-
setValidateOptions(validateOptions) {
|
|
222
|
-
this._validateOptions = !!validateOptions;
|
|
223
|
-
return this;
|
|
224
|
-
}
|
|
225
|
-
setCooldown(cooldown) {
|
|
226
|
-
this._cooldown = cooldown;
|
|
227
|
-
return this;
|
|
228
|
-
}
|
|
229
|
-
setRequiredBotPermissions(...permissions) {
|
|
230
|
-
this._requiredBotPermissions = (0, discord_js_1.normalizeArray)(permissions);
|
|
231
|
-
return this;
|
|
232
|
-
}
|
|
233
|
-
setRequiredMemberPermissions(...permissions) {
|
|
234
|
-
this._requiredMemberPermissions = (0, discord_js_1.normalizeArray)(permissions);
|
|
235
|
-
return this;
|
|
236
|
-
}
|
|
237
|
-
setHalt(halt) {
|
|
238
|
-
this._halt = halt || undefined;
|
|
239
|
-
return this;
|
|
240
|
-
}
|
|
241
|
-
setExecute(execute) {
|
|
242
|
-
if ((0, discord_js_1.isValidationEnabled)() && (!execute || typeof execute !== 'function'))
|
|
243
|
-
throw new TypeError('execute must be a function.');
|
|
244
|
-
this._execute = execute;
|
|
245
|
-
return this;
|
|
246
|
-
}
|
|
247
|
-
setMetadata(metadata) {
|
|
248
|
-
this.metadata = metadata;
|
|
249
|
-
return this;
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Returns JSON object of this builder
|
|
253
|
-
*/
|
|
254
|
-
toJSON() {
|
|
255
|
-
return {
|
|
256
|
-
type: this.type,
|
|
257
|
-
name: this.name,
|
|
258
|
-
description: this.description,
|
|
259
|
-
aliases: this.aliases,
|
|
260
|
-
cooldown: this.cooldown,
|
|
261
|
-
requiredBotPermissions: this.requiredBotPermissions,
|
|
262
|
-
requiredMemberPermissions: this.requiredMemberPermissions,
|
|
263
|
-
halt: this.halt,
|
|
264
|
-
execute: this.execute,
|
|
265
|
-
metadata: this.metadata,
|
|
266
|
-
allowExecuteByBots: this.allowExecuteByBots,
|
|
267
|
-
allowExecuteInDM: this.allowExecuteInDM,
|
|
268
|
-
validateOptions: this.validateOptions,
|
|
269
|
-
options: this.options.map(o => (o instanceof MessageCommandOptionBuilder_1.MessageCommandOptionBuilder ? o.toJSON() : o)),
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Resolve message command data/builder
|
|
274
|
-
* @param commandData Command data to resolve
|
|
275
|
-
*/
|
|
276
|
-
static resolveMessageCommand(commandData) {
|
|
277
|
-
return this.isMessageCommandBuilder(commandData) ? commandData : new MessageCommandBuilder(commandData);
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Is a message command builder
|
|
281
|
-
* @param builder data to check
|
|
282
|
-
*/
|
|
283
|
-
static isMessageCommandBuilder(builder) {
|
|
284
|
-
return builder instanceof MessageCommandBuilder;
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Is a message command execute data
|
|
288
|
-
* @param executeData data to check
|
|
289
|
-
*/
|
|
290
|
-
static isMessageCommandExecuteData(executeData) {
|
|
291
|
-
return executeData.type == builders_1.CommandType.MessageCommand && this.isMessageCommandBuilder(executeData.builder);
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Is a message command halt data
|
|
295
|
-
*/
|
|
296
|
-
static isMessageCommandHaltData(haltData) {
|
|
297
|
-
return this.isMessageCommandExecuteData(haltData.executeData);
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* Validate message command options
|
|
301
|
-
* @param builder Command builder
|
|
302
|
-
* @param options Parsed command args
|
|
303
|
-
*/
|
|
304
|
-
static async validateOptions(builder, commandArgs) {
|
|
305
|
-
const args = Array.isArray(commandArgs) ? commandArgs : commandArgs.args || [];
|
|
306
|
-
const allOptions = [...(builder.options ?? []).filter(o => o.required), ...(builder.options ?? []).filter(o => !o.required)];
|
|
307
|
-
const result = [];
|
|
308
|
-
for (let i = 0; i < allOptions.length; i++) {
|
|
309
|
-
const arg = args[i];
|
|
310
|
-
result.push(await MessageCommandOptionBuilder_1.MessageCommandOptionBuilder.validateOption(allOptions[i], arg));
|
|
311
|
-
}
|
|
312
|
-
return new MessageCommandOptionManager_1.MessageCommandOptionManager(...result);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
exports.MessageCommandBuilder = MessageCommandBuilder;
|
|
316
|
-
//# sourceMappingURL=MessageCommandBuilder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MessageCommandBuilder.js","sourceRoot":"","sources":["../../../../../src/reciple/classes/builders/MessageCommandBuilder.ts"],"names":[],"mappings":";;;AAAA,mDAA8M;AAC9M,2CAA6G;AAC7G,yFAAsF;AAEtF,+EAA4E;AAsE5E;;GAEG;AACH,MAAa,qBAAqB;IAkB9B,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IACD,IAAI,WAAW;QACX,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IACD,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IACD,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IACD,IAAI,eAAe;QACf,OAAO,IAAI,CAAC,gBAAgB,CAAC;I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