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.
Files changed (109) hide show
  1. package/LICENSE +674 -674
  2. package/bin/bin.d.mts +2 -0
  3. package/bin/bin.mjs +73 -0
  4. package/bin/bin.mjs.map +1 -0
  5. package/bin/classes/Config.d.ts +32 -0
  6. package/bin/classes/Config.js +72 -0
  7. package/bin/classes/Config.js.map +1 -0
  8. package/bin/esm.d.mts +1 -0
  9. package/{dist/lib → bin}/esm.mjs +0 -0
  10. package/bin/esm.mjs.map +1 -0
  11. package/bin/index.d.ts +5 -0
  12. package/bin/index.js +22 -0
  13. package/bin/index.js.map +1 -0
  14. package/bin/utils/cli.d.ts +4 -0
  15. package/bin/utils/cli.js +20 -0
  16. package/bin/utils/cli.js.map +1 -0
  17. package/bin/utils/logger.d.ts +6 -0
  18. package/bin/utils/logger.js +61 -0
  19. package/bin/utils/logger.js.map +1 -0
  20. package/bin/utils/modules.d.ts +3 -0
  21. package/bin/utils/modules.js +35 -0
  22. package/bin/utils/modules.js.map +1 -0
  23. package/package.json +25 -67
  24. package/static/config.yml +97 -0
  25. package/README.md +0 -182
  26. package/dist/lib/bin.mjs +0 -77
  27. package/dist/lib/bin.mjs.map +0 -1
  28. package/dist/lib/esm.mjs.map +0 -1
  29. package/dist/lib/index.js +0 -34
  30. package/dist/lib/index.js.map +0 -1
  31. package/dist/lib/reciple/classes/RecipleClient.js +0 -293
  32. package/dist/lib/reciple/classes/RecipleClient.js.map +0 -1
  33. package/dist/lib/reciple/classes/RecipleConfig.js +0 -107
  34. package/dist/lib/reciple/classes/RecipleConfig.js.map +0 -1
  35. package/dist/lib/reciple/classes/RecipleModule.js +0 -137
  36. package/dist/lib/reciple/classes/RecipleModule.js.map +0 -1
  37. package/dist/lib/reciple/classes/builders/MessageCommandBuilder.js +0 -316
  38. package/dist/lib/reciple/classes/builders/MessageCommandBuilder.js.map +0 -1
  39. package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js +0 -127
  40. package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js.map +0 -1
  41. package/dist/lib/reciple/classes/builders/SlashCommandBuilder.js +0 -253
  42. package/dist/lib/reciple/classes/builders/SlashCommandBuilder.js.map +0 -1
  43. package/dist/lib/reciple/classes/managers/ApplicationCommandManager.js +0 -179
  44. package/dist/lib/reciple/classes/managers/ApplicationCommandManager.js.map +0 -1
  45. package/dist/lib/reciple/classes/managers/CommandCooldownManager.js +0 -100
  46. package/dist/lib/reciple/classes/managers/CommandCooldownManager.js.map +0 -1
  47. package/dist/lib/reciple/classes/managers/CommandManager.js +0 -65
  48. package/dist/lib/reciple/classes/managers/CommandManager.js.map +0 -1
  49. package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js +0 -26
  50. package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js.map +0 -1
  51. package/dist/lib/reciple/classes/managers/ModuleManager.js +0 -181
  52. package/dist/lib/reciple/classes/managers/ModuleManager.js.map +0 -1
  53. package/dist/lib/reciple/flags.js +0 -32
  54. package/dist/lib/reciple/flags.js.map +0 -1
  55. package/dist/lib/reciple/permissions.js +0 -31
  56. package/dist/lib/reciple/permissions.js.map +0 -1
  57. package/dist/lib/reciple/types/builders.js +0 -12
  58. package/dist/lib/reciple/types/builders.js.map +0 -1
  59. package/dist/lib/reciple/types/commands.js +0 -16
  60. package/dist/lib/reciple/types/commands.js.map +0 -1
  61. package/dist/lib/reciple/types/paramOptions.js +0 -3
  62. package/dist/lib/reciple/types/paramOptions.js.map +0 -1
  63. package/dist/lib/reciple/util.js +0 -72
  64. package/dist/lib/reciple/util.js.map +0 -1
  65. package/dist/lib/reciple/version.js +0 -48
  66. package/dist/lib/reciple/version.js.map +0 -1
  67. package/dist/types/bin.d.mts +0 -3
  68. package/dist/types/bin.d.mts.map +0 -1
  69. package/dist/types/esm.d.mts +0 -2
  70. package/dist/types/esm.d.mts.map +0 -1
  71. package/dist/types/index.d.ts +0 -18
  72. package/dist/types/index.d.ts.map +0 -1
  73. package/dist/types/reciple/classes/RecipleClient.d.ts +0 -116
  74. package/dist/types/reciple/classes/RecipleClient.d.ts.map +0 -1
  75. package/dist/types/reciple/classes/RecipleConfig.d.ts +0 -102
  76. package/dist/types/reciple/classes/RecipleConfig.d.ts.map +0 -1
  77. package/dist/types/reciple/classes/RecipleModule.d.ts +0 -88
  78. package/dist/types/reciple/classes/RecipleModule.d.ts.map +0 -1
  79. package/dist/types/reciple/classes/builders/MessageCommandBuilder.d.ts +0 -198
  80. package/dist/types/reciple/classes/builders/MessageCommandBuilder.d.ts.map +0 -1
  81. package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts +0 -54
  82. package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts.map +0 -1
  83. package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts +0 -107
  84. package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts.map +0 -1
  85. package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts +0 -54
  86. package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts.map +0 -1
  87. package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts +0 -71
  88. package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts.map +0 -1
  89. package/dist/types/reciple/classes/managers/CommandManager.d.ts +0 -35
  90. package/dist/types/reciple/classes/managers/CommandManager.d.ts.map +0 -1
  91. package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts +0 -23
  92. package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts.map +0 -1
  93. package/dist/types/reciple/classes/managers/ModuleManager.d.ts +0 -50
  94. package/dist/types/reciple/classes/managers/ModuleManager.d.ts.map +0 -1
  95. package/dist/types/reciple/flags.d.ts +0 -18
  96. package/dist/types/reciple/flags.d.ts.map +0 -1
  97. package/dist/types/reciple/permissions.d.ts +0 -16
  98. package/dist/types/reciple/permissions.d.ts.map +0 -1
  99. package/dist/types/reciple/types/builders.d.ts +0 -206
  100. package/dist/types/reciple/types/builders.d.ts.map +0 -1
  101. package/dist/types/reciple/types/commands.d.ts +0 -86
  102. package/dist/types/reciple/types/commands.d.ts.map +0 -1
  103. package/dist/types/reciple/types/paramOptions.d.ts +0 -102
  104. package/dist/types/reciple/types/paramOptions.d.ts.map +0 -1
  105. package/dist/types/reciple/util.d.ts +0 -27
  106. package/dist/types/reciple/util.d.ts.map +0 -1
  107. package/dist/types/reciple/version.d.ts +0 -26
  108. package/dist/types/reciple/version.d.ts.map +0 -1
  109. package/resource/reciple.yml +0 -122
package/README.md DELETED
@@ -1,182 +0,0 @@
1
- <h1 align="center">
2
- <img src="https://i.imgur.com/DWM0tJL.png" width="50%">
3
- <br>
4
- </h1>
5
-
6
- <h3 align="center">
7
- <a href="https://npmjs.org/package/reciple">
8
- <img src="https://img.shields.io/npm/v/reciple?label=latest%20npm%20release%20">
9
- </a>
10
- <a href="https://github.com/FalloutStudios/Reciple/blob/main/LICENSE">
11
- <img src="https://img.shields.io/github/license/FalloutStudios/Reciple">
12
- </a>
13
- <a href="https://www.codefactor.io/repository/github/falloutstudios/reciple/overview/main">
14
- <img src="https://www.codefactor.io/repository/github/falloutstudios/reciple/badge/main">
15
- </a>
16
-
17
- A simple Dicord.js handler that just works.
18
- </h3>
19
-
20
- ***
21
-
22
- <p align="center">
23
- <a href="https://discord.gg/2CattJYNpw" title="">
24
- <img src="https://i.imgur.com/GffJByO.png" alt="Join Discord">
25
- </a>
26
- </p>
27
-
28
- # Features
29
-
30
- * [CLI based handler](#command-line)
31
- * [Message command builder](#messagecommandbuilder-example)
32
- * [Built-in message command validation](#built-in-message-command-validation)
33
- * Automatically register application commands
34
- * [Built-in command cooldowns](#command-cooldowns)
35
- * [Highly configurable](#config)
36
-
37
- ## Installation
38
-
39
- To install the bot, run the following command in your terminal:
40
-
41
- ```bash
42
- npm i reciple discord.js
43
- ```
44
-
45
- You can initialize the bot to the current directory with the following command in your terminal:
46
-
47
- ```bash
48
- npx reciple
49
- ```
50
-
51
- It will ask you to continue if the directory is not empty. Type `y` to continue. After the bot has been initialized, it will ask you for your bot token.
52
-
53
- > You can change the token anytime you want
54
-
55
- ## Config
56
-
57
- You can configure the bot in `reciple.yml` located in the bot's root directory.
58
-
59
- ### Token
60
-
61
- You can directly change the token in `reciple.yml`.
62
-
63
- ```yml
64
- token: "YOUR_TOKEN_HERE"
65
- ```
66
-
67
- Using environment variables is also supported.
68
-
69
- ```yml
70
- token: "env:TOKEN_VARIABLE"
71
- ```
72
-
73
- You can override the given token using your terminal
74
-
75
- ```bash
76
- npx reciple --token "YOUR_TOKEN_HERE"
77
- ```
78
-
79
- Use env variable
80
-
81
- ```bash
82
- npx reciple --token "env:TOKEN_VARIABLE"
83
- ```
84
-
85
- ## Starting the bot
86
- To start the bot, run the following command:
87
-
88
- ```bash
89
- npx reciple
90
- ```
91
-
92
- ## Command line
93
-
94
- **Usage:** `reciple [options] [current-working-directory]`
95
-
96
- **Arguments:**
97
- * `current-working-directory` Change the current working directory
98
-
99
- **Options:**
100
- * `-v, --version` output the version number
101
- * `-t, --token <token>` Replace used bot token
102
- * `-c, --config <config>` Change path to config file
103
- * `-D, --debugmode` Enable debug mode
104
- * `-y, --yes` Automatically agree to Reciple confirmation prompts
105
- * `-h, --help` display help for command
106
-
107
- ## MessageCommandBuilder Example
108
-
109
- * Read docs for [MessageCommandBuilder](https://reciple.js.org/#/docs/reciple.js/main/class/MessageCommandBuilder)
110
-
111
- ```js
112
- new MessageCommandBuilder()
113
- .setName("command")
114
- .setDescription("Your lil tiny description")
115
- .addAliases('cmd', 'cmd1')
116
- .setExecute(command => command.message.reply("Hello!"))
117
- ```
118
-
119
- ## Built-in message command validation
120
-
121
- * Read docs for [MessageCommandBuilder#setValidateOptions()](https://reciple.js.org/#/docs/reciple.js/main/class/MessageCommandBuilder?scrollTo=setValidateOptions), [MessageCommandOptionBuilder](https://reciple.js.org/#/docs/reciple.js/main/class/MessageCommandOptionBuilder), [MessageCommandOptionManager](https://reciple.js.org/#/docs/reciple.js/main/class/MessageCommandOptionManager)
122
- ```js
123
- new MessageCommandBuilder()
124
- .setName("command")
125
- .setDescription("Your lil tiny description")
126
- .addAliases('cmd', 'cmd1')
127
- .setValidateOptions(true) // Validate options
128
- .addOption(option => option
129
- .setName("quantity")
130
- .setDescription("Must be a number")
131
- .setRequired(true) // A required option
132
- .setValidator(val => !isNaN(Number(val))) // Validate value
133
- )
134
- .setExecute(async command => {
135
- const quantity = Number(command.options.getValue('quantity', true));
136
-
137
- await command.message.reply("Quantity: " + quantity);
138
- })
139
- ```
140
-
141
- ## Command Cooldowns
142
-
143
- * Read docs for [SlashCommandBuilder#setCooldown()](https://reciple.js.org/#/docs/reciple.js/main/class/SlashCommandBuilder?scrollTo=setCooldown), [MessageCommandBuilder#setCooldown()](https://reciple.js.org/#/docs/reciple.js/main/class/MessageCommandBuilder?scrollTo=setCooldown), [CommandHaltReason](https://reciple.js.org/#/docs/reciple.js/main/typedef/CommandHaltReason), [CommandCooldownData](https://reciple.js.org/#/docs/reciple.js/main/typedef/CommandCooldownData)
144
-
145
- ```js
146
- // Slash command
147
- new SlashCommandBuilder()
148
- .setName("command")
149
- .setDescription("Your lil tiny description")
150
- .setCooldown(1000 * 60) // Cooldown in milliseconds
151
- .setExecute(command => command.interaction.reply('hi'))
152
- .setHalt(async halt => {
153
- // Handle command on cooldown
154
- if (halt.reason == CommandHaltReason.Cooldown) {
155
- await halt.executeData.interaction.reply((halt.expireTime - Date.now()) / 1000 + " seconds cooldown");
156
- return true;
157
- }
158
- })
159
-
160
- // Message command
161
- new MessageCommandBuilder()
162
- .setName("command")
163
- .setDescription("Your lil tiny description")
164
- .setCooldown(1000 * 60) // Cooldown in milliseconds
165
- .setExecute(command => command.message.reply('hi'))
166
- .setHalt(async halt => {
167
- // Handle command on cooldown
168
- if (halt.reason == CommandHaltReason.Cooldown) {
169
- await halt.executeData.message.reply((halt.expireTime - Date.now()) / 1000 + " seconds cooldown");
170
- return true;
171
- }
172
- })
173
- ```
174
-
175
- ***
176
-
177
- > ## Fun Fact
178
- > The name reciple is from a minecraft bug. The bug was a misspelling of the word `recipe`. [View Mojang Bug Report](https://bugs.mojang.com/browse/MC-225837)
179
-
180
- ***
181
-
182
- [#letTheEarthBreathe](https://rebellion.global/)
package/dist/lib/bin.mjs DELETED
@@ -1,77 +0,0 @@
1
- #!/usr/bin/env node
2
- import { RecipleClient } from './reciple/classes/RecipleClient.js';
3
- import { RecipleConfig } from './reciple/classes/RecipleConfig.js';
4
- import { existsSync, mkdirSync, readdirSync } from 'fs';
5
- import { rawVersion } from './reciple/version.js';
6
- import { cwd, flags } from './reciple/flags.js';
7
- import { path } from './reciple/util.js';
8
- import { input } from 'fallout-utility';
9
- import match from 'micromatch';
10
- import { inspect } from 'util';
11
- import chalk from 'chalk';
12
- import 'dotenv/config';
13
- import { Events } from 'discord.js';
14
- const allowedFiles = ['node_modules', 'reciple.yml', 'package.json', '.*'];
15
- const configPath = path.join(cwd, 'reciple.yml');
16
- if (!existsSync(cwd))
17
- mkdirSync(cwd, { recursive: true });
18
- if (readdirSync(cwd).some(f => match.isMatch(f, allowedFiles)) && !existsSync(flags.config ?? configPath)) {
19
- const ask = (flags.yes ? 'y' : null) ?? input('Would you like to create Reciple config here? [y/n] ') ?? '';
20
- if (ask.toString().toLowerCase() !== 'y')
21
- process.exit(0);
22
- }
23
- let configParser;
24
- try {
25
- configParser = new RecipleConfig(flags.config ?? configPath).parseConfig();
26
- }
27
- catch (err) {
28
- console.error(`${chalk.bold.red('Config Error')}: ${inspect(err)}`);
29
- process.exit(1);
30
- }
31
- const config = configParser.getConfig();
32
- const client = new RecipleClient({ config: config, cwd, ...config.client });
33
- /**
34
- * Start
35
- */
36
- if (!client.isClientLogsSilent)
37
- client.logger.info('Starting Reciple client v' + rawVersion);
38
- await client.modules.startModules({
39
- modules: await client.modules.resolveModuleFiles({
40
- files: await client.modules.getModulePaths({
41
- filter: file => file.endsWith('.js') || file.endsWith('.cjs') || file.endsWith('.mjs'),
42
- }),
43
- }),
44
- });
45
- client.on(Events.ClientReady, async () => {
46
- const failedModuleds = await client.modules.loadModules();
47
- client.modules.modules.sweep(m => failedModuleds.some(fm => fm.id === m.id));
48
- const unloadModulesAndStopProcess = async (signal) => {
49
- const unloadedModules = await client.modules.unloadModules({ reason: 'ProcessExit' });
50
- client.modules.modules.sweep(m => unloadedModules.some(fm => fm.id === m.id));
51
- client.logger.warn(`Exitting process${signal === 'SIGINT' ? ': keyboard interrupt' : signal === 'SIGTERM' ? ': terminate' : signal}`);
52
- process.exit();
53
- };
54
- process.once('SIGINT', signal => unloadModulesAndStopProcess(signal));
55
- process.once('SIGTERM', signal => unloadModulesAndStopProcess(signal));
56
- if (!client.isClientLogsSilent)
57
- client.logger.log(`Loaded ${client.commands.slashCommands.size} slash commands`, `Loaded ${client.commands.messageCommands.size} message commands`);
58
- if (client.config.commands.slashCommand.registerCommands && (client.config.commands.slashCommand.allowRegisterEmptyCommandList || client.applicationCommands.size)) {
59
- await client.commands.registerApplicationCommands();
60
- }
61
- if (!client.isClientLogsSilent)
62
- client.logger.warn(`Logged in as ${client.user?.tag || 'Unknown'}!`);
63
- client.on(Events.CacheSweep, () => client.cooldowns.clean());
64
- client.on(Events.MessageCreate, message => {
65
- if (client.config.commands.messageCommand.enabled)
66
- client.messageCommandExecute(message);
67
- });
68
- client.on(Events.InteractionCreate, interaction => {
69
- if (client.config.commands.slashCommand.enabled)
70
- client.slashCommandExecute(interaction);
71
- });
72
- });
73
- client.login(config.token).catch(err => {
74
- if (!client.isClientLogsSilent)
75
- client.logger.error(err);
76
- });
77
- //# sourceMappingURL=bin.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bin.mjs","sourceRoot":"","sources":["../../src/bin.mts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAA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A,cAAc,YAAY,CAAC"}
package/dist/lib/index.js DELETED
@@ -1,34 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./reciple/classes/builders/MessageCommandBuilder.js"), exports);
18
- __exportStar(require("./reciple/classes/builders/MessageCommandOptionBuilder.js"), exports);
19
- __exportStar(require("./reciple/classes/builders/SlashCommandBuilder.js"), exports);
20
- __exportStar(require("./reciple/classes/managers/ApplicationCommandManager.js"), exports);
21
- __exportStar(require("./reciple/classes/managers/CommandCooldownManager.js"), exports);
22
- __exportStar(require("./reciple/classes/managers/CommandManager.js"), exports);
23
- __exportStar(require("./reciple/classes/managers/MessageCommandOptionManager.js"), exports);
24
- __exportStar(require("./reciple/classes/managers/ModuleManager.js"), exports);
25
- __exportStar(require("./reciple/classes/RecipleClient.js"), exports);
26
- __exportStar(require("./reciple/classes/RecipleConfig.js"), exports);
27
- __exportStar(require("./reciple/classes/RecipleModule.js"), exports);
28
- __exportStar(require("./reciple/types/builders.js"), exports);
29
- __exportStar(require("./reciple/types/commands.js"), exports);
30
- __exportStar(require("./reciple/flags"), exports);
31
- __exportStar(require("./reciple/permissions.js"), exports);
32
- __exportStar(require("./reciple/util.js"), exports);
33
- __exportStar(require("./reciple/version.js"), exports);
34
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sFAAoE;AACpE,4FAA0E;AAC1E,oFAAkE;AAClE,0FAAwE;AACxE,uFAAqE;AACrE,+EAA6D;AAC7D,4FAA0E;AAC1E,8EAA4D;AAC5D,qEAAmD;AACnD,qEAAmD;AACnD,qEAAmD;AACnD,8DAA4C;AAC5C,8DAA4C;AAC5C,kDAAgC;AAChC,2DAAyC;AACzC,oDAAkC;AAClC,uDAAqC"}
@@ -1,293 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RecipleClient = exports.RecipleEvents = void 0;
4
- const discord_js_1 = require("discord.js");
5
- const MessageCommandBuilder_1 = require("./builders/MessageCommandBuilder");
6
- const SlashCommandBuilder_1 = require("./builders/SlashCommandBuilder");
7
- const commands_1 = require("../types/commands");
8
- const CommandCooldownManager_1 = require("./managers/CommandCooldownManager");
9
- const builders_1 = require("../types/builders");
10
- const permissions_1 = require("../permissions");
11
- const MessageCommandOptionManager_1 = require("./managers/MessageCommandOptionManager");
12
- const ApplicationCommandManager_1 = require("./managers/ApplicationCommandManager");
13
- const util_1 = require("../util");
14
- const CommandManager_1 = require("./managers/CommandManager");
15
- const ModuleManager_1 = require("./managers/ModuleManager");
16
- const RecipleConfig_1 = require("./RecipleConfig");
17
- const fallout_utility_1 = require("fallout-utility");
18
- const version_js_1 = require("../version.js");
19
- const flags_1 = require("../flags");
20
- var RecipleEvents;
21
- (function (RecipleEvents) {
22
- RecipleEvents["RecipleCommandExecute"] = "recipleCommandExecute";
23
- RecipleEvents["RecipleCommandHalt"] = "recipleCommandHalt";
24
- RecipleEvents["RecipleRegisterApplicationCommands"] = "recipleRegisterApplicationCommands";
25
- RecipleEvents["RecipleReplyError"] = "recipleReplyError";
26
- RecipleEvents["CommandExecute"] = "recipleCommandExecute";
27
- RecipleEvents["CommandHalt"] = "recipleCommandHalt";
28
- RecipleEvents["RegisterApplicationCommands"] = "recipleRegisterApplicationCommands";
29
- RecipleEvents["ReplyError"] = "recipleReplyError";
30
- })(RecipleEvents = exports.RecipleEvents || (exports.RecipleEvents = {}));
31
- class RecipleClient extends discord_js_1.Client {
32
- get isClientLogsSilent() {
33
- return !this.config.fileLogging.clientLogs;
34
- }
35
- /**
36
- * @param options Client options
37
- */
38
- constructor(options) {
39
- super(options);
40
- this.config = RecipleConfig_1.RecipleConfig.getDefaultConfig();
41
- this.commands = new CommandManager_1.CommandManager({
42
- client: this,
43
- });
44
- this.cooldowns = new CommandCooldownManager_1.CommandCooldownManager();
45
- this.modules = new ModuleManager_1.ModuleManager({
46
- client: this,
47
- });
48
- this.version = version_js_1.version;
49
- this.logger = (0, util_1.createLogger)(!!options.config?.fileLogging.stringifyLoggedJSON, options.config?.fileLogging.debugmode);
50
- this.config = { ...this.config, ...(options.config ?? {}) };
51
- if (this.config.fileLogging.enabled)
52
- this.logger.logFile(util_1.path.join(flags_1.cwd, this.config.fileLogging.logFilePath ?? 'logs/latest.log'), false);
53
- this.cwd = options.cwd ?? process.cwd();
54
- this.applicationCommands = new ApplicationCommandManager_1.ApplicationCommandManager(this);
55
- }
56
- /**
57
- * Listed to command executions
58
- * @deprecated Not useful
59
- */
60
- addCommandListeners() {
61
- (0, util_1.deprecationWarning)(`RecipleClient#addCommandListeners() is deprecated! Listen to commands manually.`);
62
- this.on(discord_js_1.Events.MessageCreate, message => {
63
- if (this.config.commands.messageCommand.enabled)
64
- this.messageCommandExecute(message);
65
- });
66
- this.on(discord_js_1.Events.InteractionCreate, interaction => {
67
- if (this.config.commands.slashCommand.enabled)
68
- this.slashCommandExecute(interaction);
69
- });
70
- return this;
71
- }
72
- /**
73
- * Execute a slash command
74
- * @param interaction Slash command interaction
75
- */
76
- async slashCommandExecute(interaction) {
77
- if (!interaction || !interaction.isChatInputCommand() || !this.isReady())
78
- return;
79
- if (!this.config.commands.slashCommand.acceptRepliedInteractions && (interaction.replied || interaction.deferred))
80
- return;
81
- const command = this.commands.get(interaction.commandName, builders_1.CommandType.SlashCommand);
82
- if (!command)
83
- return;
84
- const executeData = {
85
- type: command.type,
86
- interaction,
87
- builder: command,
88
- client: this,
89
- };
90
- const userCooldown = {
91
- user: interaction.user,
92
- command: command.name,
93
- channel: interaction.channel ?? undefined,
94
- guild: interaction.guild,
95
- type: builders_1.CommandType.SlashCommand,
96
- };
97
- if (this.config.commands.slashCommand.useLegacyPermissionsChecking &&
98
- !(0, permissions_1.userHasCommandPermissions)({
99
- builder: command,
100
- memberPermissions: interaction.memberPermissions ?? undefined,
101
- commandPermissions: this.config.commands.slashCommand.permissions,
102
- })) {
103
- if (!(await this._haltCommand(command, { executeData, reason: commands_1.CommandHaltReason.MissingMemberPermissions }))) {
104
- await interaction.reply(this.getConfigMessage('noPermissions', 'You do not have permission to use this command.')).catch(er => this._replyError(er));
105
- }
106
- return;
107
- }
108
- if (interaction.inCachedGuild() && !(0, permissions_1.botHasExecutePermissions)(interaction.channel || interaction.guild, command.requiredBotPermissions)) {
109
- if (!(await this._haltCommand(command, { executeData, reason: commands_1.CommandHaltReason.MissingBotPermissions }))) {
110
- await interaction.reply(this.getConfigMessage('insufficientBotPerms', 'Insufficient bot permissions.')).catch(er => this._replyError(er));
111
- }
112
- return;
113
- }
114
- if (this.config.commands.slashCommand.enableCooldown && command.cooldown && !this.cooldowns.isCooledDown(userCooldown)) {
115
- this.cooldowns.add({
116
- ...userCooldown,
117
- expireTime: Date.now() + command.cooldown,
118
- });
119
- }
120
- else if (this.config.commands.slashCommand.enableCooldown && command.cooldown) {
121
- if (!(await this._haltCommand(command, { executeData, reason: commands_1.CommandHaltReason.Cooldown, ...this.cooldowns.get(userCooldown) }))) {
122
- await interaction.reply(this.getConfigMessage('cooldown', 'You cannot execute this command right now due to the cooldown.')).catch(er => this._replyError(er));
123
- }
124
- return;
125
- }
126
- return this._executeCommand(command, executeData);
127
- }
128
- /**
129
- * Execute a Message command
130
- * @param message Message command executor
131
- * @param prefix Message command prefix
132
- */
133
- async messageCommandExecute(message, prefix) {
134
- if (!message.content || !this.isReady())
135
- return;
136
- const parseCommand = (0, fallout_utility_1.getCommand)(message.content, prefix || this.config.commands.messageCommand.prefix || '!', this.config.commands.messageCommand.commandArgumentSeparator || ' ');
137
- if (!parseCommand || !parseCommand?.command)
138
- return;
139
- const command = this.commands.get(parseCommand.command, builders_1.CommandType.MessageCommand);
140
- if (!command)
141
- return;
142
- const commandOptions = await MessageCommandBuilder_1.MessageCommandBuilder.validateOptions(command, parseCommand);
143
- const executeData = {
144
- type: command.type,
145
- message: message,
146
- options: commandOptions,
147
- command: parseCommand,
148
- builder: command,
149
- client: this,
150
- };
151
- const userCooldown = {
152
- user: message.author,
153
- command: command.name,
154
- channel: message.channel,
155
- guild: message.guild,
156
- type: builders_1.CommandType.MessageCommand,
157
- };
158
- if ((!command.allowExecuteInDM && message.channel.type === discord_js_1.ChannelType.DM) || (!command.allowExecuteByBots && (message.author.bot || message.author.system)))
159
- return;
160
- if (!(0, permissions_1.userHasCommandPermissions)({
161
- builder: command,
162
- memberPermissions: message.member?.permissions,
163
- commandPermissions: this.config.commands.messageCommand.permissions,
164
- })) {
165
- if (!(await this._haltCommand(command, { executeData, reason: commands_1.CommandHaltReason.MissingMemberPermissions }))) {
166
- await message.reply(this.getConfigMessage('noPermissions', 'You do not have permission to use this command.')).catch(er => this._replyError(er));
167
- }
168
- return;
169
- }
170
- if (command.validateOptions) {
171
- if (commandOptions.some(o => o.invalid)) {
172
- if (!(await this._haltCommand(command, {
173
- executeData,
174
- reason: commands_1.CommandHaltReason.InvalidArguments,
175
- invalidArguments: new MessageCommandOptionManager_1.MessageCommandOptionManager(...executeData.options.filter(o => o.invalid)),
176
- }))) {
177
- message.reply(this.getConfigMessage('invalidArguments', 'Invalid argument(s) given.')).catch(er => this._replyError(er));
178
- }
179
- return;
180
- }
181
- if (commandOptions.some(o => o.missing)) {
182
- if (!(await this._haltCommand(command, {
183
- executeData,
184
- reason: commands_1.CommandHaltReason.MissingArguments,
185
- missingArguments: new MessageCommandOptionManager_1.MessageCommandOptionManager(...executeData.options.filter(o => o.missing)),
186
- }))) {
187
- message.reply(this.getConfigMessage('missingArguments', 'Not enough arguments.')).catch(er => this._replyError(er));
188
- }
189
- return;
190
- }
191
- }
192
- if (message.inGuild() && !(0, permissions_1.botHasExecutePermissions)(message.channel || message.guild, command.requiredBotPermissions)) {
193
- if (!(await this._haltCommand(command, { executeData, reason: commands_1.CommandHaltReason.MissingBotPermissions }))) {
194
- message.reply(this.getConfigMessage('insufficientBotPerms', 'Insufficient bot permissions.')).catch(er => this._replyError(er));
195
- }
196
- return;
197
- }
198
- if (this.config.commands.messageCommand.enableCooldown && command.cooldown && !this.cooldowns.isCooledDown(userCooldown)) {
199
- this.cooldowns.add({
200
- ...userCooldown,
201
- expireTime: Date.now() + command.cooldown,
202
- });
203
- }
204
- else if (this.config.commands.messageCommand.enableCooldown && command.cooldown) {
205
- if (!(await this._haltCommand(command, { executeData, reason: commands_1.CommandHaltReason.Cooldown, ...this.cooldowns.get(userCooldown) }))) {
206
- await message.reply(this.getConfigMessage('cooldown', 'You cannot execute this command right now due to the cooldown.')).catch(er => this._replyError(er));
207
- }
208
- return;
209
- }
210
- return this._executeCommand(command, executeData);
211
- }
212
- /**
213
- * Get a message from config
214
- * @param messageKey Config messages key
215
- * @param defaultMessage Default message when the key does not exists
216
- */
217
- getConfigMessage(messageKey, defaultMessage) {
218
- return this.config.messages[messageKey] ?? defaultMessage ?? messageKey;
219
- }
220
- /**
221
- * Emits the {@link RecipleClientEvents["recipleReplyError"]} event
222
- * @param error Received Error
223
- */
224
- _replyError(error) {
225
- this.emit(RecipleEvents.ReplyError, error);
226
- }
227
- async _haltCommand(command, haltData) {
228
- try {
229
- const haltResolved = (command.halt
230
- ? await Promise.resolve(command.type == builders_1.CommandType.SlashCommand ? command.halt(haltData) : command.halt(haltData)).catch(err => {
231
- throw err;
232
- })
233
- : false) || false;
234
- this.emit(RecipleEvents.CommandHalt, haltData);
235
- return haltResolved;
236
- }
237
- catch (err) {
238
- if (!this.isClientLogsSilent) {
239
- this.logger.error(`An error occured executing command halt for "${command.name}"`);
240
- this.logger.error(err);
241
- }
242
- return false;
243
- }
244
- }
245
- async _executeCommand(command, executeData) {
246
- try {
247
- await Promise.resolve(command.type === builders_1.CommandType.SlashCommand ? command.execute(executeData) : command.execute(executeData))
248
- .then(() => this.emit(RecipleEvents.CommandExecute, executeData))
249
- .catch(async (err) => !(await this._haltCommand(command, {
250
- executeData: executeData,
251
- reason: commands_1.CommandHaltReason.Error,
252
- error: err,
253
- }))
254
- ? this._commandExecuteError(err, executeData)
255
- : void 0);
256
- return executeData;
257
- }
258
- catch (err) {
259
- if (await this._haltCommand(command, {
260
- executeData: executeData,
261
- reason: commands_1.CommandHaltReason.Error,
262
- error: err,
263
- }))
264
- return;
265
- await this._commandExecuteError(err, executeData);
266
- }
267
- }
268
- /**
269
- * Error message when a command fails to execute
270
- * @param err Received error
271
- * @param command Slash/Message command execute data
272
- */
273
- async _commandExecuteError(err, command) {
274
- if (!this.isClientLogsSilent) {
275
- this.logger.error(`An error occured executing ${command.builder.type == builders_1.CommandType.MessageCommand ? 'message' : 'slash'} command "${command.builder.name}"`);
276
- this.logger.error(err);
277
- }
278
- if (!err || !command)
279
- return;
280
- if (SlashCommandBuilder_1.SlashCommandBuilder.isSlashCommandExecuteData(command)) {
281
- if (!this.config.commands.slashCommand.replyOnError)
282
- return;
283
- await command.interaction.followUp(this.getConfigMessage('error', 'An error occurred.')).catch(er => this._replyError(er));
284
- }
285
- else if (MessageCommandBuilder_1.MessageCommandBuilder.isMessageCommandExecuteData(command)) {
286
- if (!this.config.commands.messageCommand.replyOnError)
287
- return;
288
- await command.message.reply(this.getConfigMessage('error', 'An error occurred.')).catch(er => this._replyError(er));
289
- }
290
- }
291
- }
292
- exports.RecipleClient = RecipleClient;
293
- //# sourceMappingURL=RecipleClient.js.map
@@ -1 +0,0 @@
1
- {"version":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