reciple 8.2.2 → 8.2.4

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 (3) hide show
  1. package/README.md +207 -207
  2. package/package.json +4 -5
  3. package/static/config.mjs +78 -78
package/README.md CHANGED
@@ -1,207 +1,207 @@
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://discord.gg/kajdev-1032785824686817291">
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/falloutstudios/reciple/overview/main">
17
- <img src="https://www.codefactor.io/repository/github/falloutstudios/reciple/badge/main">
18
- </a>
19
- <br>
20
- <div style="padding-top: 1rem">
21
- <a href="https://discord.gg/kajdev-1032785824686817291">
22
- <img src="https://discord.com/api/guilds/1032785824686817291/embed.png?style=banner2">
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
- ## Manual Installation
51
-
52
- To install the handler, run the following command in your terminal:
53
-
54
- ```bash
55
- npm i reciple @reciple/core discord.js
56
- ```
57
-
58
- ## CLI usage
59
-
60
- ```yml
61
- Usage: reciple [options] [cwd]
62
-
63
- Reciple is a Discord.js bot framework
64
-
65
- Arguments:
66
- cwd Change the current working directory
67
-
68
- Options:
69
- -v, --version output the version number
70
- -t, --token <token> Replace used bot token
71
- -c, --config <dir> Set path to a config file (default: "reciple.mjs")
72
- -D, --debugmode Enable debug mode
73
- -y, --yes Agree to all Reciple confirmation prompts
74
- --env <file> .env file location
75
- --shardmode Modifies some functionalities to support sharding
76
- --setup Create required config without starting the bot
77
- --cache-config <file> Add custom caching config
78
- --sweeper-config <file> Add custom sweeper config
79
- -h, --help display help for command
80
- ```
81
-
82
- ## Message Commands
83
-
84
- Reciple provides a built-in `MessageCommandBuilder` class that can be used for message command handler.
85
-
86
- [**Read Docs**](https://reciple.js.org/docs/core/main/classes:MessageCommandBuilder)
87
- ```js
88
- import { MessageCommandBuilder } from 'reciple';
89
-
90
- new MessageCommandBuilder()
91
- .setName("command")
92
- .setDescription("Your lil tiny description")
93
- .addAliases("cmd", "cmd1")
94
- .setExecute(command => command.message.reply("Hello!"));
95
- ```
96
-
97
- ### Validate Message Command Options
98
-
99
- [**Read Docs**](https://reciple.js.org/docs/core/main/classes:MessageCommandOptionBuilder)
100
- ```js
101
- import { MessageCommandBuilder } from 'reciple';
102
-
103
- new MessageCommandBuilder()
104
- .setName("command")
105
- .setDescription("Your lil tiny description")
106
- .addAliases("cmd", "cmd1")
107
- .setValidateOptions(true) // Validate options
108
- .addOption(option => option
109
- .setName("quantity")
110
- .setDescription("Must be a number")
111
- .setRequired(true) // A required option
112
- .setValidate(val => !isNaN(Number(val))) // Validate value
113
- .setResolveValue(val => Number(val)) // Resolves the option value
114
- )
115
- .setExecute(async command => {
116
- /**
117
- * @type {number}
118
- */
119
- const quantity = await data.options.getOptionValue('number', { required: true, resolveValue: true });;
120
- await command.message.reply("Quantity: " + quantity);
121
- });
122
- ```
123
-
124
- ## Context Menus
125
-
126
- Reciple provides extended `ContextMenuCommandBuilder` class that can be used for context menu command handler.
127
-
128
- [**Read Docs**](https://reciple.js.org/docs/core/main/classes:ContextMenuCommandBuilder)
129
- ```js
130
- import { ApplicationCommandType } from 'discord.js';
131
- import { ContextMenuCommandBuilder } from 'reciple';
132
-
133
- new ContextMenuCommandBuilder()
134
- .setName("Ban")
135
- .setType(ApplicationCommandType.User)
136
- .setExecute(async ({ interaction }) => {
137
- if (!interaction.inCachedGuild()) return;
138
- await interaction.targetMember.ban();
139
- });
140
- ```
141
-
142
- ## Slash Commands
143
-
144
- Reciple provides extended `SlashCommandBuilder` class that can be used for slash command handler.
145
- [**Read Docs**](https://reciple.js.org/docs/core/main/classes:SlashCommandBuilder)
146
-
147
- ```js
148
- import { SlashCommandMenuBuilder } from 'reciple';
149
-
150
- new SlashCommandBuilder()
151
- .setName("ping")
152
- .setDescription("Pong")
153
- .setExecute(async ({ interaction }) => interaction.reply(`Pong!`));
154
- ```
155
-
156
- ## Command Cooldowns
157
-
158
- [**Read Docs**](https://reciple.js.org/docs/core/main/classes:BaseCommandBuilder#setcooldown)
159
-
160
- ```js
161
- import { ContextMenuCommandBuilder, MessageCommandBuilder, SlashCommandBuilder } from 'reciple';
162
- import { ApplicationCommandType } from 'discord.js';
163
-
164
- new ContextMenuCommandBuilder()
165
- .setName("Context Menu")
166
- .setType(ApplicationCommandType.Message)
167
- .setCooldown(1000 * 5) // 5 seconds cooldown
168
- .setExecute(async ({ interaction }) => interaction.reply(`Hello!`));
169
-
170
- new MessageCommandBuilder()
171
- .setName("message-command")
172
- .setDescription(`Your command`)
173
- .setCooldown(1000 * 5) // 5 seconds cooldown
174
- .setExecute(async ({ message }) => message.reply(`Hello!`));
175
-
176
- new SlashCommandBuilder()
177
- .setName("slash-command")
178
- .setDescription(`Your command`)
179
- .setCooldown(1000 * 5) // 5 seconds cooldown
180
- .setExecute(async ({ interaction }) => interaction.reply(`Hello!`));
181
- ```
182
-
183
- ## Config
184
-
185
- You can configure the bot in `reciple.mjs` or `reciple.cjs` usually located in the bot's root directory.
186
-
187
- ### Token
188
-
189
- You can change the token in config.
190
-
191
- ```js
192
- token: "Your Token" // Directly set token string
193
- token: process.env.TOKEN // Use env variable
194
- ```
195
-
196
- You can override the given token as cli flag
197
-
198
- ```bash
199
- reciple --token "YOUR_TOKEN_HERE"
200
- reciple --token "env:TOKEN_VARIABLE"
201
- ```
202
-
203
- ---
204
-
205
- > ## Fun Fact
206
- >
207
- > 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)
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://discord.gg/kajdev-1032785824686817291">
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/falloutstudios/reciple/overview/main">
17
+ <img src="https://www.codefactor.io/repository/github/falloutstudios/reciple/badge/main">
18
+ </a>
19
+ <br>
20
+ <div style="padding-top: 1rem">
21
+ <a href="https://discord.gg/kajdev-1032785824686817291">
22
+ <img src="https://discord.com/api/guilds/1032785824686817291/embed.png?style=banner2">
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
+ ## Manual Installation
51
+
52
+ To install the handler, run the following command in your terminal:
53
+
54
+ ```bash
55
+ npm i reciple @reciple/core discord.js
56
+ ```
57
+
58
+ ## CLI usage
59
+
60
+ ```yml
61
+ Usage: reciple [options] [cwd]
62
+
63
+ Reciple is a Discord.js bot framework
64
+
65
+ Arguments:
66
+ cwd Change the current working directory
67
+
68
+ Options:
69
+ -v, --version output the version number
70
+ -t, --token <token> Replace used bot token
71
+ -c, --config <dir> Set path to a config file (default: "reciple.mjs")
72
+ -D, --debugmode Enable debug mode
73
+ -y, --yes Agree to all Reciple confirmation prompts
74
+ --env <file> .env file location
75
+ --shardmode Modifies some functionalities to support sharding
76
+ --setup Create required config without starting the bot
77
+ --cache-config <file> Add custom caching config
78
+ --sweeper-config <file> Add custom sweeper config
79
+ -h, --help display help for command
80
+ ```
81
+
82
+ ## Message Commands
83
+
84
+ Reciple provides a built-in `MessageCommandBuilder` class that can be used for message command handler.
85
+
86
+ [**Read Docs**](https://reciple.js.org/docs/core/main/classes:MessageCommandBuilder)
87
+ ```js
88
+ import { MessageCommandBuilder } from 'reciple';
89
+
90
+ new MessageCommandBuilder()
91
+ .setName("command")
92
+ .setDescription("Your lil tiny description")
93
+ .addAliases("cmd", "cmd1")
94
+ .setExecute(command => command.message.reply("Hello!"));
95
+ ```
96
+
97
+ ### Validate Message Command Options
98
+
99
+ [**Read Docs**](https://reciple.js.org/docs/core/main/classes:MessageCommandOptionBuilder)
100
+ ```js
101
+ import { MessageCommandBuilder } from 'reciple';
102
+
103
+ new MessageCommandBuilder()
104
+ .setName("command")
105
+ .setDescription("Your lil tiny description")
106
+ .addAliases("cmd", "cmd1")
107
+ .setValidateOptions(true) // Validate options
108
+ .addOption(option => option
109
+ .setName("quantity")
110
+ .setDescription("Must be a number")
111
+ .setRequired(true) // A required option
112
+ .setValidate(val => !isNaN(Number(val))) // Validate value
113
+ .setResolveValue(val => Number(val)) // Resolves the option value
114
+ )
115
+ .setExecute(async command => {
116
+ /**
117
+ * @type {number}
118
+ */
119
+ const quantity = await data.options.getOptionValue('number', { required: true, resolveValue: true });;
120
+ await command.message.reply("Quantity: " + quantity);
121
+ });
122
+ ```
123
+
124
+ ## Context Menus
125
+
126
+ Reciple provides extended `ContextMenuCommandBuilder` class that can be used for context menu command handler.
127
+
128
+ [**Read Docs**](https://reciple.js.org/docs/core/main/classes:ContextMenuCommandBuilder)
129
+ ```js
130
+ import { ApplicationCommandType } from 'discord.js';
131
+ import { ContextMenuCommandBuilder } from 'reciple';
132
+
133
+ new ContextMenuCommandBuilder()
134
+ .setName("Ban")
135
+ .setType(ApplicationCommandType.User)
136
+ .setExecute(async ({ interaction }) => {
137
+ if (!interaction.inCachedGuild()) return;
138
+ await interaction.targetMember.ban();
139
+ });
140
+ ```
141
+
142
+ ## Slash Commands
143
+
144
+ Reciple provides extended `SlashCommandBuilder` class that can be used for slash command handler.
145
+ [**Read Docs**](https://reciple.js.org/docs/core/main/classes:SlashCommandBuilder)
146
+
147
+ ```js
148
+ import { SlashCommandMenuBuilder } from 'reciple';
149
+
150
+ new SlashCommandBuilder()
151
+ .setName("ping")
152
+ .setDescription("Pong")
153
+ .setExecute(async ({ interaction }) => interaction.reply(`Pong!`));
154
+ ```
155
+
156
+ ## Command Cooldowns
157
+
158
+ [**Read Docs**](https://reciple.js.org/docs/core/main/classes:BaseCommandBuilder#setcooldown)
159
+
160
+ ```js
161
+ import { ContextMenuCommandBuilder, MessageCommandBuilder, SlashCommandBuilder } from 'reciple';
162
+ import { ApplicationCommandType } from 'discord.js';
163
+
164
+ new ContextMenuCommandBuilder()
165
+ .setName("Context Menu")
166
+ .setType(ApplicationCommandType.Message)
167
+ .setCooldown(1000 * 5) // 5 seconds cooldown
168
+ .setExecute(async ({ interaction }) => interaction.reply(`Hello!`));
169
+
170
+ new MessageCommandBuilder()
171
+ .setName("message-command")
172
+ .setDescription(`Your command`)
173
+ .setCooldown(1000 * 5) // 5 seconds cooldown
174
+ .setExecute(async ({ message }) => message.reply(`Hello!`));
175
+
176
+ new SlashCommandBuilder()
177
+ .setName("slash-command")
178
+ .setDescription(`Your command`)
179
+ .setCooldown(1000 * 5) // 5 seconds cooldown
180
+ .setExecute(async ({ interaction }) => interaction.reply(`Hello!`));
181
+ ```
182
+
183
+ ## Config
184
+
185
+ You can configure the bot in `reciple.mjs` or `reciple.cjs` usually located in the bot's root directory.
186
+
187
+ ### Token
188
+
189
+ You can change the token in config.
190
+
191
+ ```js
192
+ token: "Your Token" // Directly set token string
193
+ token: process.env.TOKEN // Use env variable
194
+ ```
195
+
196
+ You can override the given token as cli flag
197
+
198
+ ```bash
199
+ reciple --token "YOUR_TOKEN_HERE"
200
+ reciple --token "env:TOKEN_VARIABLE"
201
+ ```
202
+
203
+ ---
204
+
205
+ > ## Fun Fact
206
+ >
207
+ > 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/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": "8.2.2",
6
+ "version": "8.2.4",
7
7
  "main": "./dist/index.js",
8
8
  "module": "./dist/esm.mjs",
9
9
  "types": "./dist/index.d.ts",
@@ -41,20 +41,19 @@
41
41
  "README.md"
42
42
  ],
43
43
  "dependencies": {
44
- "@reciple/update-checker": "^8.1.0",
44
+ "@reciple/update-checker": "^8.1.1",
45
45
  "@reciple/utils": "^8.1.0",
46
46
  "commander": "^11.1.0",
47
47
  "dotenv": "^16.3.1",
48
48
  "fallout-utility": "^2.8.0",
49
49
  "globby": "^14.0.0",
50
- "lodash.mergewith": "^4.6.2",
51
50
  "micromatch": "^4.0.5",
52
51
  "prompts": "^2.4.2",
53
52
  "semver": "^7.5.4",
54
53
  "typescript": "^5.2.2"
55
54
  },
56
55
  "devDependencies": {
57
- "@reciple/core": "^8.2.2",
56
+ "@reciple/core": "^8.2.4",
58
57
  "@types/micromatch": "^4.0.5",
59
58
  "@types/semver": "^7.5.5",
60
59
  "discord.js": "^14.14.1"
@@ -63,5 +62,5 @@
63
62
  "@reciple/core": "^8.0.0",
64
63
  "discord.js": "^14.7.1"
65
64
  },
66
- "gitHead": "adc09a22aa56d722a22674baab6af3492eb5e591"
65
+ "gitHead": "a590b5c96c25dba68cb592c1c931cefefce9a2cb"
67
66
  }
package/static/config.mjs CHANGED
@@ -1,78 +1,78 @@
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
- CooldownPrecondition.create(),
71
- CommandPermissionsPrecondition.create()
72
- ],
73
- cooldownSweeperOptions: {
74
- timer: 1000 * 60 * 60
75
- },
76
- checkForUpdates: true,
77
- version: `^${cliVersion}`
78
- };
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
+ CooldownPrecondition.create(),
71
+ CommandPermissionsPrecondition.create()
72
+ ],
73
+ cooldownSweeperOptions: {
74
+ timer: 1000 * 60 * 60
75
+ },
76
+ checkForUpdates: true,
77
+ version: `^${cliVersion}`
78
+ };