reciple 7.9.8 → 7.9.10

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 (2) hide show
  1. package/README.md +214 -213
  2. package/package.json +9 -8
package/README.md CHANGED
@@ -1,213 +1,214 @@
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
- <br>
17
- A simple Dicord.js handler that just works.
18
- </h3>
19
-
20
- ## Features
21
-
22
- - [CLI based handler](#cli-usage)
23
- - [Supports Context Menus](#context-menus)
24
- - [Supports Prefix/Message commands](#message-commands)
25
- - [Validate messsage command options](#validate-message-command-options)
26
- - [Supports Slash Commands](#slash-commands)
27
- - [Built-in command cooldowns](#command-cooldowns)
28
- - Automatically register application commands
29
- - [Highly configurable](#config)
30
-
31
- ## Using Templates
32
-
33
- To use templates use the following command in your terminal:
34
-
35
- ```bash
36
- npm create reciple@latest
37
- ```
38
-
39
- After that configure the template you want to use.
40
-
41
- ## Manual Installation
42
-
43
- To install the handler, run the following command in your terminal:
44
-
45
- ```bash
46
- npm i reciple discord.js
47
- ```
48
-
49
- You can initialize the bot to the current directory with the following command in your terminal:
50
-
51
- ```bash
52
- npx reciple
53
- ```
54
-
55
- 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.
56
-
57
- > You can change the token anytime you want
58
-
59
- ## CLI usage
60
-
61
- ```yml
62
- Usage: reciple [options] [cwd]
63
-
64
- Reciple is a Discord.js bot framework
65
-
66
- Arguments:
67
- cwd Change the current working directory
68
-
69
- Options:
70
- -v, --version output the version number
71
- -t, --token <token> Replace used bot token
72
- -c, --config <dir> Change path to config file
73
- -D, --debugmode Enable debug mode
74
- -y, --yes Agree to all Reciple confirmation prompts
75
- --env <file> .env file location
76
- --shardmode Modifies some functionalities to support sharding
77
- --setup Create required config without starting the bot
78
- -h, --help display help for command
79
- ```
80
-
81
- ## Message Commands
82
-
83
- Reciple provides built-in `MessageCommandBuilder` class that can be used for message command handler.
84
-
85
- ```js
86
- const { MessageCommandBuilder } = require("reciple");
87
-
88
- new MessageCommandBuilder()
89
- .setName("command")
90
- .setDescription("Your lil tiny description")
91
- .addAliases("cmd", "cmd1")
92
- .setExecute((command) => command.message.reply("Hello!"));
93
- ```
94
-
95
- ### Validate Message Command Options
96
-
97
- ```js
98
- const { MessageCommandBuilder } = require("reciple");
99
-
100
- new MessageCommandBuilder()
101
- .setName("command")
102
- .setDescription("Your lil tiny description")
103
- .addAliases("cmd", "cmd1")
104
- .setValidateOptions(true) // Validate options
105
- .addOption(
106
- (option) =>
107
- option
108
- .setName("quantity")
109
- .setDescription("Must be a number")
110
- .setRequired(true) // A required option
111
- .setValidator((val) => !isNaN(Number(val))) // Validate value
112
- )
113
- .setExecute(async (command) => {
114
- const quantity = Number(command.options.getValue("quantity", true));
115
-
116
- await command.message.reply("Quantity: " + quantity);
117
- });
118
- ```
119
-
120
- ## Context Menus
121
-
122
- Reciple provides custom `ContextMenuBuilder` class that can be used for context menu command handler.
123
-
124
- ```js
125
- const { ContextMenuBuilder } = require("reciple");
126
- const { ApplicationCommandType } = require("discord.js");
127
-
128
- new ContextMenuBuilder()
129
- .setName("Ban")
130
- .setType(ApplicationCommandType.User)
131
- .setExecute(async ({ interaction }) => {
132
- if (!interaction.inCachedGuild()) return;
133
- await interaction.member.ban();
134
- });
135
- ```
136
-
137
- ## Slash Commands
138
-
139
- Reciple provides custom `SlashCommandBuilder` class that can be used for slash command handler.
140
-
141
- ```js
142
- const { SlashCommandBuilder } = require("reciple");
143
-
144
- new SlashCommandBuilder()
145
- .setName("ping")
146
- .setDescription("Pong")
147
- .setExecute(async ({ interaction }) => interaction.reply(`Pong!`));
148
- ```
149
-
150
- ## Command Cooldowns
151
-
152
- ```js
153
- const {
154
- MessageCommandBuilder,
155
- MessageCommandBuilder,
156
- SlashCommandBuilder,
157
- } = require("reciple");
158
- const { ApplicationCommandType } = require("discord.js");
159
-
160
- new ContextMenuCommandBuilder()
161
- .setName("Context Menu")
162
- .setType(ApplicationCommandType.Message)
163
- .setCooldown(1000 * 5) // 5 seconds cooldown
164
- .setExecute(async ({ interaction }) => interaction.reply(`Hello!`));
165
-
166
- new ContextMenuCommandBuilder()
167
- .setName("message-command")
168
- .setDescription(`Your command`)
169
- .setCooldown(1000 * 5) // 5 seconds cooldown
170
- .setExecute(async ({ message }) => message.reply(`Hello!`));
171
-
172
- new SlashCommandBuilder()
173
- .setName("slash-command")
174
- .setDescription(`Your command`)
175
- .setCooldown(1000 * 5) // 5 seconds cooldown
176
- .setExecute(async ({ interaction }) => interaction.reply(`Hello!`));
177
- ```
178
-
179
- ## Config
180
-
181
- You can configure the bot in `reciple.yml` located in the bot's root directory.
182
-
183
- ### Token
184
-
185
- You can directly change the token in `reciple.yml`.
186
-
187
- ```yml
188
- token: "YOUR_TOKEN_HERE"
189
- ```
190
-
191
- Using environment variables is also supported.
192
-
193
- ```yml
194
- token: "env:TOKEN_VARIABLE"
195
- ```
196
-
197
- You can override the given token using your terminal
198
-
199
- ```bash
200
- npx reciple --token "YOUR_TOKEN_HERE"
201
- ```
202
-
203
- Use env variable
204
-
205
- ```bash
206
- npx reciple --token "env:TOKEN_VARIABLE"
207
- ```
208
-
209
- ---
210
-
211
- > ## Fun Fact
212
- >
213
- > 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/VzP8qW7Z8d">
8
+ <img src="https://img.shields.io/discord/993105237000855592?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/FalloutStudios/Reciple/blob/main/LICENSE">
14
+ <img src="https://img.shields.io/npm/dt/reciple.svg?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
+ </h3>
20
+
21
+ ## Features
22
+
23
+ - [CLI based handler](#cli-usage)
24
+ - [Supports Context Menus](#context-menus)
25
+ - [Supports Prefix/Message commands](#message-commands)
26
+ - [Validate messsage command options](#validate-message-command-options)
27
+ - [Supports Slash Commands](#slash-commands)
28
+ - [Built-in command cooldowns](#command-cooldowns)
29
+ - Automatically register application commands
30
+ - [Highly configurable](#config)
31
+
32
+ ## Using Templates
33
+
34
+ To use templates use the following command in your terminal:
35
+
36
+ ```bash
37
+ npm create reciple@latest
38
+ ```
39
+
40
+ After that configure the template you want to use.
41
+
42
+ ## Manual Installation
43
+
44
+ To install the handler, run the following command in your terminal:
45
+
46
+ ```bash
47
+ npm i reciple discord.js
48
+ ```
49
+
50
+ You can initialize the bot to the current directory with the following command in your terminal:
51
+
52
+ ```bash
53
+ npx reciple
54
+ ```
55
+
56
+ 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.
57
+
58
+ > You can change the token anytime you want
59
+
60
+ ## CLI usage
61
+
62
+ ```yml
63
+ Usage: reciple [options] [cwd]
64
+
65
+ Reciple is a Discord.js bot framework
66
+
67
+ Arguments:
68
+ cwd Change the current working directory
69
+
70
+ Options:
71
+ -v, --version output the version number
72
+ -t, --token <token> Replace used bot token
73
+ -c, --config <dir> Change path to config file
74
+ -D, --debugmode Enable debug mode
75
+ -y, --yes Agree to all Reciple confirmation prompts
76
+ --env <file> .env file location
77
+ --shardmode Modifies some functionalities to support sharding
78
+ --setup Create required config without starting the bot
79
+ -h, --help display help for command
80
+ ```
81
+
82
+ ## Message Commands
83
+
84
+ Reciple provides built-in `MessageCommandBuilder` class that can be used for message command handler.
85
+
86
+ ```js
87
+ const { MessageCommandBuilder } = require("reciple");
88
+
89
+ new MessageCommandBuilder()
90
+ .setName("command")
91
+ .setDescription("Your lil tiny description")
92
+ .addAliases("cmd", "cmd1")
93
+ .setExecute((command) => command.message.reply("Hello!"));
94
+ ```
95
+
96
+ ### Validate Message Command Options
97
+
98
+ ```js
99
+ const { MessageCommandBuilder } = require("reciple");
100
+
101
+ new MessageCommandBuilder()
102
+ .setName("command")
103
+ .setDescription("Your lil tiny description")
104
+ .addAliases("cmd", "cmd1")
105
+ .setValidateOptions(true) // Validate options
106
+ .addOption(
107
+ (option) =>
108
+ option
109
+ .setName("quantity")
110
+ .setDescription("Must be a number")
111
+ .setRequired(true) // A required option
112
+ .setValidator((val) => !isNaN(Number(val))) // Validate value
113
+ )
114
+ .setExecute(async (command) => {
115
+ const quantity = Number(command.options.getValue("quantity", true));
116
+
117
+ await command.message.reply("Quantity: " + quantity);
118
+ });
119
+ ```
120
+
121
+ ## Context Menus
122
+
123
+ Reciple provides custom `ContextMenuBuilder` class that can be used for context menu command handler.
124
+
125
+ ```js
126
+ const { ContextMenuBuilder } = require("reciple");
127
+ const { ApplicationCommandType } = require("discord.js");
128
+
129
+ new ContextMenuBuilder()
130
+ .setName("Ban")
131
+ .setType(ApplicationCommandType.User)
132
+ .setExecute(async ({ interaction }) => {
133
+ if (!interaction.inCachedGuild()) return;
134
+ await interaction.member.ban();
135
+ });
136
+ ```
137
+
138
+ ## Slash Commands
139
+
140
+ Reciple provides custom `SlashCommandBuilder` class that can be used for slash command handler.
141
+
142
+ ```js
143
+ const { SlashCommandBuilder } = require("reciple");
144
+
145
+ new SlashCommandBuilder()
146
+ .setName("ping")
147
+ .setDescription("Pong")
148
+ .setExecute(async ({ interaction }) => interaction.reply(`Pong!`));
149
+ ```
150
+
151
+ ## Command Cooldowns
152
+
153
+ ```js
154
+ const {
155
+ MessageCommandBuilder,
156
+ MessageCommandBuilder,
157
+ SlashCommandBuilder,
158
+ } = require("reciple");
159
+ const { ApplicationCommandType } = require("discord.js");
160
+
161
+ new ContextMenuCommandBuilder()
162
+ .setName("Context Menu")
163
+ .setType(ApplicationCommandType.Message)
164
+ .setCooldown(1000 * 5) // 5 seconds cooldown
165
+ .setExecute(async ({ interaction }) => interaction.reply(`Hello!`));
166
+
167
+ new ContextMenuCommandBuilder()
168
+ .setName("message-command")
169
+ .setDescription(`Your command`)
170
+ .setCooldown(1000 * 5) // 5 seconds cooldown
171
+ .setExecute(async ({ message }) => message.reply(`Hello!`));
172
+
173
+ new SlashCommandBuilder()
174
+ .setName("slash-command")
175
+ .setDescription(`Your command`)
176
+ .setCooldown(1000 * 5) // 5 seconds cooldown
177
+ .setExecute(async ({ interaction }) => interaction.reply(`Hello!`));
178
+ ```
179
+
180
+ ## Config
181
+
182
+ You can configure the bot in `reciple.yml` located in the bot's root directory.
183
+
184
+ ### Token
185
+
186
+ You can directly change the token in `reciple.yml`.
187
+
188
+ ```yml
189
+ token: "YOUR_TOKEN_HERE"
190
+ ```
191
+
192
+ Using environment variables is also supported.
193
+
194
+ ```yml
195
+ token: "env:TOKEN_VARIABLE"
196
+ ```
197
+
198
+ You can override the given token using your terminal
199
+
200
+ ```bash
201
+ npx reciple --token "YOUR_TOKEN_HERE"
202
+ ```
203
+
204
+ Use env variable
205
+
206
+ ```bash
207
+ npx reciple --token "env:TOKEN_VARIABLE"
208
+ ```
209
+
210
+ ---
211
+
212
+ > ## Fun Fact
213
+ >
214
+ > 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": "7.9.8",
6
+ "version": "7.9.10",
7
7
  "main": "./bin/index.js",
8
8
  "module": "./bin/esm.mjs",
9
9
  "types": "./bin/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "scripts": {
30
30
  "clean": "npx rimraf ./bin",
31
31
  "build": "npm run clean && npx tsc",
32
- "docs": "npx docgen -i ./src/exports.ts -c ./docs/custom.json -o ./docs/docs.json --typescript"
32
+ "docs": "node ../docgen/dist/bin.js -i ./src/exports.ts -o ./docs/docs.json"
33
33
  },
34
34
  "files": [
35
35
  "bin",
@@ -37,8 +37,8 @@
37
37
  "README.md"
38
38
  ],
39
39
  "dependencies": {
40
- "@reciple/client": "^7.8.6",
41
- "@reciple/update-checker": "^7.2.2",
40
+ "@reciple/client": "^7.8.8",
41
+ "@reciple/update-checker": "^7.2.3",
42
42
  "commander": "^11.0.0",
43
43
  "dotenv": "^16.3.1",
44
44
  "fallout-utility": "^2.7.1",
@@ -47,17 +47,18 @@
47
47
  "micromatch": "^4.0.5",
48
48
  "prompts": "^2.4.2",
49
49
  "semver": "^7.5.4",
50
- "yaml": "^2.3.1"
50
+ "typescript": "^5.2.2",
51
+ "yaml": "^2.3.2"
51
52
  },
52
53
  "devDependencies": {
53
54
  "@types/lodash.mergewith": "^4.6.7",
54
55
  "@types/micromatch": "^4.0.2",
55
56
  "@types/prompts": "^2.4.4",
56
- "@types/semver": "^7.5.0",
57
- "discord.js": "^14.12.1"
57
+ "@types/semver": "^7.5.2",
58
+ "discord.js": "^14.13.0"
58
59
  },
59
60
  "peerDependencies": {
60
61
  "discord.js": "^14.7.1"
61
62
  },
62
- "gitHead": "6a2b6ed078f1996bf5716512a1495a265ae86ef2"
63
+ "gitHead": "c5b7e4cb11a23eb21830bea7264e1985b93e9085"
63
64
  }