reciple 9.0.0-dev.9 → 9.0.1
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/README.md +208 -207
- package/dist/utils/cli.d.ts +28 -0
- package/dist/utils/cli.js +29 -1
- package/dist/utils/cli.js.map +1 -1
- package/package.json +4 -5
- package/static/config.mjs +79 -79
package/README.md
CHANGED
|
@@ -1,207 +1,208 @@
|
|
|
1
|
-
<h1 align="center">
|
|
2
|
-
<img src="https://i.imgur.com/
|
|
3
|
-
<br>
|
|
4
|
-
</h1>
|
|
5
|
-
|
|
6
|
-
<h3 align="center">
|
|
7
|
-
<a href="https://discord.
|
|
8
|
-
<img src="https://img.shields.io/discord/1032785824686817291?color=5865F2&logo=discord&logoColor=white">
|
|
9
|
-
</a>
|
|
10
|
-
<a href="https://npmjs.org/package/reciple">
|
|
11
|
-
<img src="https://img.shields.io/npm/v/reciple?label=npm">
|
|
12
|
-
</a>
|
|
13
|
-
<a href="https://github.com/thenorthsolution/Reciple/tree/main/packages/reciple">
|
|
14
|
-
<img src="https://img.shields.io/npm/dt/reciple?maxAge=3600">
|
|
15
|
-
</a>
|
|
16
|
-
<a href="https://www.codefactor.io/repository/github/
|
|
17
|
-
<img src="https://www.codefactor.io/repository/github/
|
|
18
|
-
</a>
|
|
19
|
-
<br>
|
|
20
|
-
<div style="padding-top: 1rem">
|
|
21
|
-
<a href="https://discord.
|
|
22
|
-
<img src="
|
|
23
|
-
</a>
|
|
24
|
-
</div>
|
|
25
|
-
</h3>
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Highlights
|
|
30
|
-
|
|
31
|
-
- [CLI based handler](#cli-usage)
|
|
32
|
-
- [Supports Context Menus](#context-menus)
|
|
33
|
-
- [Supports Prefix/Message commands](#message-commands)
|
|
34
|
-
- [Validate messsage command options](#validate-message-command-options)
|
|
35
|
-
- [Supports Slash Commands](#slash-commands)
|
|
36
|
-
- [Built-in command cooldowns](#command-cooldowns)
|
|
37
|
-
- Automatically register application commands
|
|
38
|
-
- [Highly configurable](#config)
|
|
39
|
-
|
|
40
|
-
## Using Templates
|
|
41
|
-
|
|
42
|
-
To use templates use the following command in your terminal:
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
npm create reciple@latest
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
After that configure the template you want to use.
|
|
49
|
-
|
|
50
|
-
##
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
.
|
|
110
|
-
.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
.
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
.
|
|
178
|
-
.
|
|
179
|
-
.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
token:
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
reciple --token "
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
>
|
|
207
|
-
>
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<img src="https://i.imgur.com/h0ljJR5.png" width="50%">
|
|
3
|
+
<br>
|
|
4
|
+
</h1>
|
|
5
|
+
|
|
6
|
+
<h3 align="center">
|
|
7
|
+
<a href="https://discord.gg/thenorthsolution">
|
|
8
|
+
<img src="https://img.shields.io/discord/1032785824686817291?color=5865F2&logo=discord&logoColor=white">
|
|
9
|
+
</a>
|
|
10
|
+
<a href="https://npmjs.org/package/reciple">
|
|
11
|
+
<img src="https://img.shields.io/npm/v/reciple?label=npm">
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://github.com/thenorthsolution/Reciple/tree/main/packages/reciple">
|
|
14
|
+
<img src="https://img.shields.io/npm/dt/reciple?maxAge=3600">
|
|
15
|
+
</a>
|
|
16
|
+
<a href="https://www.codefactor.io/repository/github/thenorthsolution/reciple">
|
|
17
|
+
<img src="https://www.codefactor.io/repository/github/thenorthsolution/reciple/badge">
|
|
18
|
+
</a>
|
|
19
|
+
<br>
|
|
20
|
+
<div style="padding-top: 1rem">
|
|
21
|
+
<a href="https://discord.gg/thenorthsolution">
|
|
22
|
+
<img src="http://invidget.switchblade.xyz/thenorthsolution">
|
|
23
|
+
</a>
|
|
24
|
+
</div>
|
|
25
|
+
</h3>
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Highlights
|
|
30
|
+
|
|
31
|
+
- [CLI based handler](#cli-usage)
|
|
32
|
+
- [Supports Context Menus](#context-menus)
|
|
33
|
+
- [Supports Prefix/Message commands](#message-commands)
|
|
34
|
+
- [Validate messsage command options](#validate-message-command-options)
|
|
35
|
+
- [Supports Slash Commands](#slash-commands)
|
|
36
|
+
- [Built-in command cooldowns](#command-cooldowns)
|
|
37
|
+
- Automatically register application commands
|
|
38
|
+
- [Highly configurable](#config)
|
|
39
|
+
|
|
40
|
+
## Using Templates
|
|
41
|
+
|
|
42
|
+
To use templates use the following command in your terminal:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm create reciple@latest
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
After that configure the template you want to use. [Learn More](https://reciple.js.org/guide/getting-started/installation)
|
|
49
|
+
|
|
50
|
+
## CLI usage
|
|
51
|
+
|
|
52
|
+
```yml
|
|
53
|
+
Usage: reciple [options] [cwd]
|
|
54
|
+
|
|
55
|
+
Reciple is a Discord.js bot framework
|
|
56
|
+
|
|
57
|
+
Arguments:
|
|
58
|
+
cwd Change the current working directory
|
|
59
|
+
|
|
60
|
+
Options:
|
|
61
|
+
-v, --version output the version number
|
|
62
|
+
-t, --token <token> Replace used bot token
|
|
63
|
+
-c, --config <dir> Set path to a config file
|
|
64
|
+
-D, --debugmode Enable debug mode
|
|
65
|
+
-y, --yes Agree to all Reciple confirmation prompts
|
|
66
|
+
--env <file> .env file location
|
|
67
|
+
--shardmode Modifies some functionalities to support sharding
|
|
68
|
+
--setup Create required config without starting the bot
|
|
69
|
+
-h, --help display help for command
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Message Commands
|
|
73
|
+
|
|
74
|
+
Reciple provides a built-in `MessageCommandBuilder` class that can be used for message command handler.
|
|
75
|
+
|
|
76
|
+
[**Read Docs**](https://reciple.js.org/docs/core/main/classes:MessageCommandBuilder)
|
|
77
|
+
```js
|
|
78
|
+
import { MessageCommandBuilder } from 'reciple';
|
|
79
|
+
|
|
80
|
+
new MessageCommandBuilder()
|
|
81
|
+
.setName("command")
|
|
82
|
+
.setDescription("Your lil tiny description")
|
|
83
|
+
.addAliases("cmd", "cmd1")
|
|
84
|
+
.setExecute(command => command.message.reply("Hello!"));
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Validate Message Command Options
|
|
88
|
+
|
|
89
|
+
[**Read Docs**](https://reciple.js.org/docs/core/main/classes:MessageCommandOptionBuilder)
|
|
90
|
+
```js
|
|
91
|
+
import { MessageCommandBuilder } from 'reciple';
|
|
92
|
+
|
|
93
|
+
new MessageCommandBuilder()
|
|
94
|
+
.setName("command")
|
|
95
|
+
.setDescription("Your lil tiny description")
|
|
96
|
+
.addAliases("cmd", "cmd1")
|
|
97
|
+
.setValidateOptions(true) // Validate options
|
|
98
|
+
.addOption(option => option
|
|
99
|
+
.setName("quantity")
|
|
100
|
+
.setDescription("Must be a number")
|
|
101
|
+
.setRequired(true) // A required option
|
|
102
|
+
.setValidate(({ value }) => !isNaN(Number(value))) // Validate value
|
|
103
|
+
.setResolveValue(({ value }) => Number(value)) // Resolves the option value
|
|
104
|
+
)
|
|
105
|
+
.setExecute(async command => {
|
|
106
|
+
/**
|
|
107
|
+
* @type {number}
|
|
108
|
+
*/
|
|
109
|
+
const quantity = await data.options.getOptionValue('number', { required: true, resolveValue: true });;
|
|
110
|
+
await command.message.reply("Quantity: " + quantity);
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Context Menus
|
|
115
|
+
|
|
116
|
+
Reciple provides extended `ContextMenuCommandBuilder` class that can be used for context menu command handler.
|
|
117
|
+
|
|
118
|
+
[**Read Docs**](https://reciple.js.org/docs/core/main/classes:ContextMenuCommandBuilder)
|
|
119
|
+
```js
|
|
120
|
+
import { ApplicationCommandType } from 'discord.js';
|
|
121
|
+
import { ContextMenuCommandBuilder } from 'reciple';
|
|
122
|
+
|
|
123
|
+
new ContextMenuCommandBuilder()
|
|
124
|
+
.setName("Ban")
|
|
125
|
+
.setType(ApplicationCommandType.User)
|
|
126
|
+
.setExecute(async ({ interaction }) => {
|
|
127
|
+
if (!interaction.inCachedGuild()) return;
|
|
128
|
+
|
|
129
|
+
await interaction.deferReply();
|
|
130
|
+
await interaction.targetMember.ban();
|
|
131
|
+
await interaction.editReply(`Banned ${interaction.targetUser}`);
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Slash Commands
|
|
136
|
+
|
|
137
|
+
Reciple provides extended `SlashCommandBuilder` class that can be used for slash command handler.
|
|
138
|
+
[**Read Docs**](https://reciple.js.org/docs/core/main/classes:SlashCommandBuilder)
|
|
139
|
+
|
|
140
|
+
```js
|
|
141
|
+
import { SlashCommandMenuBuilder } from 'reciple';
|
|
142
|
+
|
|
143
|
+
new SlashCommandBuilder()
|
|
144
|
+
.setName("ping")
|
|
145
|
+
.setDescription("Pong")
|
|
146
|
+
.setExecute(async ({ interaction }) => {
|
|
147
|
+
await interaction.reply(`Pong!`);
|
|
148
|
+
});
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Command Cooldowns
|
|
152
|
+
|
|
153
|
+
[**Read Docs**](https://reciple.js.org/docs/core/main/classes:BaseCommandBuilder#setcooldown)
|
|
154
|
+
|
|
155
|
+
```js
|
|
156
|
+
import { ContextMenuCommandBuilder, MessageCommandBuilder, SlashCommandBuilder } from 'reciple';
|
|
157
|
+
import { ApplicationCommandType } from 'discord.js';
|
|
158
|
+
|
|
159
|
+
new ContextMenuCommandBuilder()
|
|
160
|
+
.setName("Context Menu")
|
|
161
|
+
.setType(ApplicationCommandType.Message)
|
|
162
|
+
.setCooldown(1000 * 5) // 5 seconds cooldown
|
|
163
|
+
.setExecute(async ({ interaction }) => {
|
|
164
|
+
await interaction.reply(`Hello!`);
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
new MessageCommandBuilder()
|
|
168
|
+
.setName("message-command")
|
|
169
|
+
.setDescription(`Your command`)
|
|
170
|
+
.setCooldown(1000 * 5) // 5 seconds cooldown
|
|
171
|
+
.setExecute(async ({ message }) => {
|
|
172
|
+
await message.reply(`Hello!`);
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
new SlashCommandBuilder()
|
|
176
|
+
.setName("slash-command")
|
|
177
|
+
.setDescription(`Your command`)
|
|
178
|
+
.setCooldown(1000 * 5) // 5 seconds cooldown
|
|
179
|
+
.setExecute(async ({ interaction }) => {
|
|
180
|
+
await interaction.reply(`Hello!`);
|
|
181
|
+
});
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Config
|
|
185
|
+
|
|
186
|
+
You can configure the bot in `reciple.mjs` usually located in the bot's root directory.
|
|
187
|
+
|
|
188
|
+
### Token
|
|
189
|
+
|
|
190
|
+
You can change the token in config.
|
|
191
|
+
|
|
192
|
+
```js
|
|
193
|
+
token: "Your Token" // Directly set token string
|
|
194
|
+
token: process.env.TOKEN // Use env variable
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
You can override the given token as cli flag
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
reciple --token "YOUR_TOKEN_HERE"
|
|
201
|
+
reciple --token "env:TOKEN_VARIABLE"
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
> ## Fun Fact
|
|
207
|
+
>
|
|
208
|
+
> 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)
|
package/dist/utils/cli.d.ts
CHANGED
|
@@ -13,14 +13,42 @@ export interface CLIOptions {
|
|
|
13
13
|
[k: string]: any;
|
|
14
14
|
}
|
|
15
15
|
export declare const cli: {
|
|
16
|
+
/**
|
|
17
|
+
* This property returns the command-line arguments passed to the CLI. It is an array of strings, where each string represents an argument.
|
|
18
|
+
*/
|
|
16
19
|
readonly args: string[];
|
|
20
|
+
/**
|
|
21
|
+
* This property returns the command-line options passed to the CLI. It is an object with keys and values depending on the options specified in the command-line arguments.
|
|
22
|
+
*/
|
|
17
23
|
readonly options: CLIOptions;
|
|
24
|
+
/**
|
|
25
|
+
* This property returns the current working directory (CWD) of the CLI. It takes into account the command-line arguments passed to the CLI.
|
|
26
|
+
*/
|
|
18
27
|
readonly cwd: string;
|
|
28
|
+
/**
|
|
29
|
+
* This property returns a boolean value indicating whether shard mode is enabled or not.
|
|
30
|
+
* It is enabled if the shardmode option is specified in the command-line arguments, or if the `SHARDMODE` environment variable is set to `1`. Otherwise, it is disabled.
|
|
31
|
+
*/
|
|
19
32
|
readonly shardmode: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* This property returns the thread ID of the current thread, if it is not the main thread.
|
|
35
|
+
*/
|
|
20
36
|
threadId: number | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* This property is used to store a boolean value indicating whether the CWD has been updated or not.
|
|
39
|
+
*/
|
|
21
40
|
isCwdUpdated: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* This property returns the current working directory of the Node.js process.
|
|
43
|
+
*/
|
|
22
44
|
nodeCwd: string;
|
|
45
|
+
/**
|
|
46
|
+
* This property returns the path of the bin.mjs file, which is the main entry point of the CLI.
|
|
47
|
+
*/
|
|
23
48
|
binPath: string;
|
|
49
|
+
/**
|
|
50
|
+
* This property is used to store the path of the log file.
|
|
51
|
+
*/
|
|
24
52
|
logPath: string | undefined;
|
|
25
53
|
};
|
|
26
54
|
export declare const cliVersion: string;
|
package/dist/utils/cli.js
CHANGED
|
@@ -3,9 +3,9 @@ import { buildVersion } from '@reciple/core';
|
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { readFileSync } from 'node:fs';
|
|
5
5
|
import { Command } from 'commander';
|
|
6
|
-
import { coerce } from 'semver';
|
|
7
6
|
import path from 'node:path';
|
|
8
7
|
import { PackageUpdateChecker } from '@reciple/utils';
|
|
8
|
+
import { coerce } from 'semver';
|
|
9
9
|
const { version, description } = JSON.parse(readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), '../../package.json'), 'utf-8'));
|
|
10
10
|
const originalCwd = process.cwd();
|
|
11
11
|
export let command = new Command()
|
|
@@ -22,18 +22,46 @@ export let command = new Command()
|
|
|
22
22
|
.option('--setup', 'Create required config without starting the bot')
|
|
23
23
|
.allowUnknownOption(true);
|
|
24
24
|
export const cli = {
|
|
25
|
+
/**
|
|
26
|
+
* This property returns the command-line arguments passed to the CLI. It is an array of strings, where each string represents an argument.
|
|
27
|
+
*/
|
|
25
28
|
get args() { return command.args; },
|
|
29
|
+
/**
|
|
30
|
+
* This property returns the command-line options passed to the CLI. It is an object with keys and values depending on the options specified in the command-line arguments.
|
|
31
|
+
*/
|
|
26
32
|
get options() { return command.opts(); },
|
|
33
|
+
/**
|
|
34
|
+
* This property returns the current working directory (CWD) of the CLI. It takes into account the command-line arguments passed to the CLI.
|
|
35
|
+
*/
|
|
27
36
|
get cwd() {
|
|
28
37
|
return this.args[0]
|
|
29
38
|
? path.isAbsolute(this.args[0]) ? this.args[0] : path.join(originalCwd, this.args[0])
|
|
30
39
|
: process.cwd();
|
|
31
40
|
},
|
|
41
|
+
/**
|
|
42
|
+
* This property returns a boolean value indicating whether shard mode is enabled or not.
|
|
43
|
+
* It is enabled if the shardmode option is specified in the command-line arguments, or if the `SHARDMODE` environment variable is set to `1`. Otherwise, it is disabled.
|
|
44
|
+
*/
|
|
32
45
|
get shardmode() { return !!(this.options.shardmode ?? process.env.SHARDMODE); },
|
|
46
|
+
/**
|
|
47
|
+
* This property returns the thread ID of the current thread, if it is not the main thread.
|
|
48
|
+
*/
|
|
33
49
|
threadId: !isMainThread && parentPort !== undefined ? threadId : undefined,
|
|
50
|
+
/**
|
|
51
|
+
* This property is used to store a boolean value indicating whether the CWD has been updated or not.
|
|
52
|
+
*/
|
|
34
53
|
isCwdUpdated: false,
|
|
54
|
+
/**
|
|
55
|
+
* This property returns the current working directory of the Node.js process.
|
|
56
|
+
*/
|
|
35
57
|
nodeCwd: process.cwd(),
|
|
58
|
+
/**
|
|
59
|
+
* This property returns the path of the bin.mjs file, which is the main entry point of the CLI.
|
|
60
|
+
*/
|
|
36
61
|
binPath: path.join(path.dirname(fileURLToPath(import.meta.url)), '../bin.mjs'),
|
|
62
|
+
/**
|
|
63
|
+
* This property is used to store the path of the log file.
|
|
64
|
+
*/
|
|
37
65
|
logPath: undefined
|
|
38
66
|
};
|
|
39
67
|
export const cliVersion = `${coerce(version)}`;
|
package/dist/utils/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/utils/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,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AAC;IAC9E;;OAEG;IACH,OAAO,EAAE,SAA6B;CACzC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;AAC/C,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC;AACvC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,oBAAoB,CAAC;IAClD,QAAQ,EAAE;QACN,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,eAAe,EAAE;QACvD,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE;KAC7D;CACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Reciple is a Discord.js bot framework",
|
|
4
4
|
"homepage": "https://reciple.js.org/docs/reciple",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
|
-
"version": "9.0.
|
|
6
|
+
"version": "9.0.1",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"bin": "./dist/bin.js",
|
|
@@ -40,8 +40,7 @@
|
|
|
40
40
|
"README.md"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@reciple/
|
|
44
|
-
"@reciple/utils": "^9.0.0-dev.2",
|
|
43
|
+
"@reciple/utils": "^9.0.1",
|
|
45
44
|
"commander": "^12.1.0",
|
|
46
45
|
"dotenv": "^16.4.5",
|
|
47
46
|
"fallout-utility": "^2.9.1",
|
|
@@ -51,7 +50,7 @@
|
|
|
51
50
|
"semver": "^7.6.2"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
|
-
"@reciple/core": "^9.0.
|
|
53
|
+
"@reciple/core": "^9.0.1",
|
|
55
54
|
"@types/micromatch": "^4.0.7",
|
|
56
55
|
"@types/semver": "^7.5.8",
|
|
57
56
|
"discord.js": "^14.15.2"
|
|
@@ -60,5 +59,5 @@
|
|
|
60
59
|
"@reciple/core": "^9 || ^9.0.0-dev",
|
|
61
60
|
"discord.js": "^14.15.0"
|
|
62
61
|
},
|
|
63
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "1f1faa3df5ab6616f6af5422f8ea024b7848994c"
|
|
64
63
|
}
|
package/static/config.mjs
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
import { CooldownPrecondition, CommandPermissionsPrecondition } from 'reciple';
|
|
3
|
-
import { IntentsBitField } from 'discord.js';
|
|
4
|
-
import { cliVersion } from 'reciple';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @satisfies {import('reciple').RecipleConfig}
|
|
8
|
-
*/
|
|
9
|
-
export const config = {
|
|
10
|
-
token: process.env.TOKEN ?? '',
|
|
11
|
-
commands: {
|
|
12
|
-
contextMenuCommand: {
|
|
13
|
-
enabled: true,
|
|
14
|
-
enableCooldown: true,
|
|
15
|
-
acceptRepliedInteractions: false,
|
|
16
|
-
registerCommands: {
|
|
17
|
-
registerGlobally: true,
|
|
18
|
-
registerToGuilds: []
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
messageCommand: {
|
|
22
|
-
enabled: true,
|
|
23
|
-
enableCooldown: true,
|
|
24
|
-
commandArgumentSeparator: ' ',
|
|
25
|
-
prefix: '!'
|
|
26
|
-
},
|
|
27
|
-
slashCommand: {
|
|
28
|
-
enabled: true,
|
|
29
|
-
enableCooldown: true,
|
|
30
|
-
acceptRepliedInteractions: false,
|
|
31
|
-
registerCommands: {
|
|
32
|
-
registerGlobally: true,
|
|
33
|
-
registerToGuilds: []
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
applicationCommandRegister: {
|
|
38
|
-
enabled: true,
|
|
39
|
-
allowRegisterGlobally: true,
|
|
40
|
-
allowRegisterToGuilds: true,
|
|
41
|
-
registerEmptyCommands: true,
|
|
42
|
-
registerToGuilds: []
|
|
43
|
-
},
|
|
44
|
-
client: {
|
|
45
|
-
intents: [
|
|
46
|
-
IntentsBitField.Flags.Guilds,
|
|
47
|
-
IntentsBitField.Flags.GuildMembers,
|
|
48
|
-
IntentsBitField.Flags.GuildMessages,
|
|
49
|
-
IntentsBitField.Flags.MessageContent,
|
|
50
|
-
]
|
|
51
|
-
},
|
|
52
|
-
logger: {
|
|
53
|
-
enabled: true,
|
|
54
|
-
debugmode: null,
|
|
55
|
-
coloredMessages: true,
|
|
56
|
-
disableLogPrefix: false,
|
|
57
|
-
logToFile: {
|
|
58
|
-
enabled: true,
|
|
59
|
-
logsFolder: './logs',
|
|
60
|
-
file: 'latest.log'
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
modules: {
|
|
64
|
-
dirs: ['./modules'],
|
|
65
|
-
exclude: [],
|
|
66
|
-
filter: file => true,
|
|
67
|
-
disableModuleVersionCheck: false
|
|
68
|
-
},
|
|
69
|
-
preconditions: [
|
|
70
|
-
new CooldownPrecondition(),
|
|
71
|
-
new CommandPermissionsPrecondition()
|
|
72
|
-
],
|
|
73
|
-
commandHalts: [],
|
|
74
|
-
cooldownSweeperOptions: {
|
|
75
|
-
timer: 1000 * 60 * 60
|
|
76
|
-
},
|
|
77
|
-
checkForUpdates: true,
|
|
78
|
-
version: `^${cliVersion}`
|
|
79
|
-
};
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { CooldownPrecondition, CommandPermissionsPrecondition } from 'reciple';
|
|
3
|
+
import { IntentsBitField } from 'discord.js';
|
|
4
|
+
import { cliVersion } from 'reciple';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @satisfies {import('reciple').RecipleConfig}
|
|
8
|
+
*/
|
|
9
|
+
export const config = {
|
|
10
|
+
token: process.env.TOKEN ?? '',
|
|
11
|
+
commands: {
|
|
12
|
+
contextMenuCommand: {
|
|
13
|
+
enabled: true,
|
|
14
|
+
enableCooldown: true,
|
|
15
|
+
acceptRepliedInteractions: false,
|
|
16
|
+
registerCommands: {
|
|
17
|
+
registerGlobally: true,
|
|
18
|
+
registerToGuilds: []
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
messageCommand: {
|
|
22
|
+
enabled: true,
|
|
23
|
+
enableCooldown: true,
|
|
24
|
+
commandArgumentSeparator: ' ',
|
|
25
|
+
prefix: '!'
|
|
26
|
+
},
|
|
27
|
+
slashCommand: {
|
|
28
|
+
enabled: true,
|
|
29
|
+
enableCooldown: true,
|
|
30
|
+
acceptRepliedInteractions: false,
|
|
31
|
+
registerCommands: {
|
|
32
|
+
registerGlobally: true,
|
|
33
|
+
registerToGuilds: []
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
applicationCommandRegister: {
|
|
38
|
+
enabled: true,
|
|
39
|
+
allowRegisterGlobally: true,
|
|
40
|
+
allowRegisterToGuilds: true,
|
|
41
|
+
registerEmptyCommands: true,
|
|
42
|
+
registerToGuilds: []
|
|
43
|
+
},
|
|
44
|
+
client: {
|
|
45
|
+
intents: [
|
|
46
|
+
IntentsBitField.Flags.Guilds,
|
|
47
|
+
IntentsBitField.Flags.GuildMembers,
|
|
48
|
+
IntentsBitField.Flags.GuildMessages,
|
|
49
|
+
IntentsBitField.Flags.MessageContent,
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
logger: {
|
|
53
|
+
enabled: true,
|
|
54
|
+
debugmode: null,
|
|
55
|
+
coloredMessages: true,
|
|
56
|
+
disableLogPrefix: false,
|
|
57
|
+
logToFile: {
|
|
58
|
+
enabled: true,
|
|
59
|
+
logsFolder: './logs',
|
|
60
|
+
file: 'latest.log'
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
modules: {
|
|
64
|
+
dirs: ['./modules'],
|
|
65
|
+
exclude: [],
|
|
66
|
+
filter: file => true,
|
|
67
|
+
disableModuleVersionCheck: false
|
|
68
|
+
},
|
|
69
|
+
preconditions: [
|
|
70
|
+
new CooldownPrecondition(),
|
|
71
|
+
new CommandPermissionsPrecondition()
|
|
72
|
+
],
|
|
73
|
+
commandHalts: [],
|
|
74
|
+
cooldownSweeperOptions: {
|
|
75
|
+
timer: 1000 * 60 * 60
|
|
76
|
+
},
|
|
77
|
+
checkForUpdates: true,
|
|
78
|
+
version: `^${cliVersion}`
|
|
79
|
+
};
|