reciple 7.1.1 → 7.1.2

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 (4) hide show
  1. package/LICENSE +674 -674
  2. package/README.md +211 -211
  3. package/package.json +4 -5
  4. package/static/config.yml +104 -104
package/README.md CHANGED
@@ -1,211 +1,211 @@
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.js - Discord.js handler cli
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 <config> Change path to config file
73
- -D, --debugmode Enable debug mode
74
- -y, --yes Agree to all Reciple confirmation prompts
75
- --env .env file location
76
- -h, --help display help for command
77
- ```
78
-
79
- ## Message Commands
80
-
81
- Reciple provides built-in `MessageCommandBuilder` class that can be used for message command handler.
82
-
83
- ```js
84
- const { MessageCommandBuilder } = require("reciple");
85
-
86
- new MessageCommandBuilder()
87
- .setName("command")
88
- .setDescription("Your lil tiny description")
89
- .addAliases("cmd", "cmd1")
90
- .setExecute((command) => command.message.reply("Hello!"));
91
- ```
92
-
93
- ### Validate Message Command Options
94
-
95
- ```js
96
- const { MessageCommandBuilder } = require("reciple");
97
-
98
- new MessageCommandBuilder()
99
- .setName("command")
100
- .setDescription("Your lil tiny description")
101
- .addAliases("cmd", "cmd1")
102
- .setValidateOptions(true) // Validate options
103
- .addOption(
104
- (option) =>
105
- option
106
- .setName("quantity")
107
- .setDescription("Must be a number")
108
- .setRequired(true) // A required option
109
- .setValidator((val) => !isNaN(Number(val))) // Validate value
110
- )
111
- .setExecute(async (command) => {
112
- const quantity = Number(command.options.getValue("quantity", true));
113
-
114
- await command.message.reply("Quantity: " + quantity);
115
- });
116
- ```
117
-
118
- ## Context Menus
119
-
120
- Reciple provides custom `ContextMenuBuilder` class that can be used for context menu command handler.
121
-
122
- ```js
123
- const { ContextMenuBuilder } = require("reciple");
124
- const { ApplicationCommandType } = require("discord.js");
125
-
126
- new ContextMenuBuilder()
127
- .setName("Ban")
128
- .setType(ApplicationCommandType.User)
129
- .setExecute(async ({ interaction }) => {
130
- if (!interaction.inCachedGuild()) return;
131
- await interaction.member.ban();
132
- });
133
- ```
134
-
135
- ## Slash Commands
136
-
137
- Reciple provides custom `SlashCommandBuilder` class that can be used for slash command handler.
138
-
139
- ```js
140
- const { SlashCommandBuilder } = require("reciple");
141
-
142
- new SlashCommandBuilder()
143
- .setName("ping")
144
- .setDescription("Pong")
145
- .setExecute(async ({ interaction }) => interaction.reply(`Pong!`));
146
- ```
147
-
148
- ## Command Cooldowns
149
-
150
- ```js
151
- const {
152
- MessageCommandBuilder,
153
- MessageCommandBuilder,
154
- SlashCommandBuilder,
155
- } = require("reciple");
156
- const { ApplicationCommandType } = require("discord.js");
157
-
158
- new ContextMenuCommandBuilder()
159
- .setName("Context Menu")
160
- .setType(ApplicationCommandType.Message)
161
- .setCooldown(1000 * 5) // 5 seconds cooldown
162
- .setExecute(async ({ interaction }) => interaction.reply(`Hello!`));
163
-
164
- new ContextMenuCommandBuilder()
165
- .setName("message-command")
166
- .setDescription(`Your command`)
167
- .setCooldown(1000 * 5) // 5 seconds cooldown
168
- .setExecute(async ({ message }) => message.reply(`Hello!`));
169
-
170
- new SlashCommandBuilder()
171
- .setName("slash-command")
172
- .setDescription(`Your command`)
173
- .setCooldown(1000 * 5) // 5 seconds cooldown
174
- .setExecute(async ({ interaction }) => interaction.reply(`Hello!`));
175
- ```
176
-
177
- ## Config
178
-
179
- You can configure the bot in `reciple.yml` located in the bot's root directory.
180
-
181
- ### Token
182
-
183
- You can directly change the token in `reciple.yml`.
184
-
185
- ```yml
186
- token: "YOUR_TOKEN_HERE"
187
- ```
188
-
189
- Using environment variables is also supported.
190
-
191
- ```yml
192
- token: "env:TOKEN_VARIABLE"
193
- ```
194
-
195
- You can override the given token using your terminal
196
-
197
- ```bash
198
- npx reciple --token "YOUR_TOKEN_HERE"
199
- ```
200
-
201
- Use env variable
202
-
203
- ```bash
204
- npx reciple --token "env:TOKEN_VARIABLE"
205
- ```
206
-
207
- ---
208
-
209
- > ## Fun Fact
210
- >
211
- > 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://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.js - Discord.js handler cli
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 <config> Change path to config file
73
+ -D, --debugmode Enable debug mode
74
+ -y, --yes Agree to all Reciple confirmation prompts
75
+ --env .env file location
76
+ -h, --help display help for command
77
+ ```
78
+
79
+ ## Message Commands
80
+
81
+ Reciple provides built-in `MessageCommandBuilder` class that can be used for message command handler.
82
+
83
+ ```js
84
+ const { MessageCommandBuilder } = require("reciple");
85
+
86
+ new MessageCommandBuilder()
87
+ .setName("command")
88
+ .setDescription("Your lil tiny description")
89
+ .addAliases("cmd", "cmd1")
90
+ .setExecute((command) => command.message.reply("Hello!"));
91
+ ```
92
+
93
+ ### Validate Message Command Options
94
+
95
+ ```js
96
+ const { MessageCommandBuilder } = require("reciple");
97
+
98
+ new MessageCommandBuilder()
99
+ .setName("command")
100
+ .setDescription("Your lil tiny description")
101
+ .addAliases("cmd", "cmd1")
102
+ .setValidateOptions(true) // Validate options
103
+ .addOption(
104
+ (option) =>
105
+ option
106
+ .setName("quantity")
107
+ .setDescription("Must be a number")
108
+ .setRequired(true) // A required option
109
+ .setValidator((val) => !isNaN(Number(val))) // Validate value
110
+ )
111
+ .setExecute(async (command) => {
112
+ const quantity = Number(command.options.getValue("quantity", true));
113
+
114
+ await command.message.reply("Quantity: " + quantity);
115
+ });
116
+ ```
117
+
118
+ ## Context Menus
119
+
120
+ Reciple provides custom `ContextMenuBuilder` class that can be used for context menu command handler.
121
+
122
+ ```js
123
+ const { ContextMenuBuilder } = require("reciple");
124
+ const { ApplicationCommandType } = require("discord.js");
125
+
126
+ new ContextMenuBuilder()
127
+ .setName("Ban")
128
+ .setType(ApplicationCommandType.User)
129
+ .setExecute(async ({ interaction }) => {
130
+ if (!interaction.inCachedGuild()) return;
131
+ await interaction.member.ban();
132
+ });
133
+ ```
134
+
135
+ ## Slash Commands
136
+
137
+ Reciple provides custom `SlashCommandBuilder` class that can be used for slash command handler.
138
+
139
+ ```js
140
+ const { SlashCommandBuilder } = require("reciple");
141
+
142
+ new SlashCommandBuilder()
143
+ .setName("ping")
144
+ .setDescription("Pong")
145
+ .setExecute(async ({ interaction }) => interaction.reply(`Pong!`));
146
+ ```
147
+
148
+ ## Command Cooldowns
149
+
150
+ ```js
151
+ const {
152
+ MessageCommandBuilder,
153
+ MessageCommandBuilder,
154
+ SlashCommandBuilder,
155
+ } = require("reciple");
156
+ const { ApplicationCommandType } = require("discord.js");
157
+
158
+ new ContextMenuCommandBuilder()
159
+ .setName("Context Menu")
160
+ .setType(ApplicationCommandType.Message)
161
+ .setCooldown(1000 * 5) // 5 seconds cooldown
162
+ .setExecute(async ({ interaction }) => interaction.reply(`Hello!`));
163
+
164
+ new ContextMenuCommandBuilder()
165
+ .setName("message-command")
166
+ .setDescription(`Your command`)
167
+ .setCooldown(1000 * 5) // 5 seconds cooldown
168
+ .setExecute(async ({ message }) => message.reply(`Hello!`));
169
+
170
+ new SlashCommandBuilder()
171
+ .setName("slash-command")
172
+ .setDescription(`Your command`)
173
+ .setCooldown(1000 * 5) // 5 seconds cooldown
174
+ .setExecute(async ({ interaction }) => interaction.reply(`Hello!`));
175
+ ```
176
+
177
+ ## Config
178
+
179
+ You can configure the bot in `reciple.yml` located in the bot's root directory.
180
+
181
+ ### Token
182
+
183
+ You can directly change the token in `reciple.yml`.
184
+
185
+ ```yml
186
+ token: "YOUR_TOKEN_HERE"
187
+ ```
188
+
189
+ Using environment variables is also supported.
190
+
191
+ ```yml
192
+ token: "env:TOKEN_VARIABLE"
193
+ ```
194
+
195
+ You can override the given token using your terminal
196
+
197
+ ```bash
198
+ npx reciple --token "YOUR_TOKEN_HERE"
199
+ ```
200
+
201
+ Use env variable
202
+
203
+ ```bash
204
+ npx reciple --token "env:TOKEN_VARIABLE"
205
+ ```
206
+
207
+ ---
208
+
209
+ > ## Fun Fact
210
+ >
211
+ > 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 handler",
4
4
  "homepage": "https://reciple.js.org/docs/reciple",
5
5
  "license": "GPL-3.0",
6
- "version": "7.1.1",
6
+ "version": "7.1.2",
7
7
  "main": "./bin/index.js",
8
8
  "module": "./bin/esm.mjs",
9
9
  "types": "./bin/index.d.ts",
@@ -37,12 +37,11 @@
37
37
  "README.md"
38
38
  ],
39
39
  "dependencies": {
40
- "@reciple/client": "^7.0.9",
41
- "@weichwarenprojekt/ts-importer": "^0.1.5",
40
+ "@reciple/client": "^7.0.10",
42
41
  "chalk": "4.1.2",
43
42
  "commander": "^10.0.0",
44
43
  "dotenv": "^16.0.3",
45
- "fallout-utility": "^2.1.3",
44
+ "fallout-utility": "^2.2.0",
46
45
  "globby": "^13.1.3",
47
46
  "micromatch": "^4.0.5",
48
47
  "prompts": "^2.4.2",
@@ -61,5 +60,5 @@
61
60
  "optionalDependencies": {
62
61
  "@weichwarenprojekt/ts-importer": "^0.1.5"
63
62
  },
64
- "gitHead": "e6e3b11c7a87cf95d4e11148760dd8777c7050f9"
63
+ "gitHead": "dea83005ec2851d13a58db8522b56827c02f4e7d"
65
64
  }
package/static/config.yml CHANGED
@@ -1,104 +1,104 @@
1
- # The bot token
2
- # You can directly set the bot token as value or use token from env
3
- # To use token from env set the value like this:
4
- # token: env:TOKEN
5
- token: TOKEN
6
-
7
- # Commands Config
8
- commands:
9
- contextMenuCommand:
10
- # If false, the client will ignore this type of command when executed
11
- enabled: true
12
- # Enable user command cooldowns if available
13
- enableCooldown: true
14
- # Command register config
15
- registerCommands:
16
- # Allow commands to be registered globally
17
- registerGlobally: true
18
- # Allow commands to be registered a given guilds/servers
19
- registerToGuilds: []
20
- # If enabled, the client will accept replied interactions of this type
21
- acceptRepliedInteractions: false
22
- slashCommand:
23
- # If false, the client will ignore this type of command when executed
24
- enabled: true
25
- # Enable user command cooldowns if available
26
- enableCooldown: true
27
- # Command register config
28
- registerCommands:
29
- # Allow commands to be registered globally
30
- registerGlobally: true
31
- # Allow commands to be registered a given guilds/servers
32
- registerToGuilds: []
33
- # If enabled, the client will accept replied interactions of this type
34
- acceptRepliedInteractions: false
35
- messageCommand:
36
- # If false, the client will ignore this type of command when executed
37
- enabled: true
38
- # Enable user command cooldowns if available
39
- enableCooldown: true
40
- # String separator for command options
41
- commandArgumentSeparator: ' '
42
- # Command prefix
43
- prefix: '!'
44
- additionalApplicationCommands:
45
- # Command register config
46
- registerCommands:
47
- # Allow commands to be registered globally
48
- registerGlobally: true
49
- # Allow commands to be registered a given guilds/servers
50
- registerToGuilds: []
51
-
52
- # Application commands register config
53
- applicationCommandRegister:
54
- # Wether allow all application commands to be registered globally
55
- # This ignores their specific configs
56
- allowRegisterGlobally: true
57
- # Wether allow all application commands to be registered to guilds
58
- # This ignores their specific configs
59
- allowRegisterOnGuilds: true
60
- # Register empty command list
61
- registerEmptyCommands: true
62
-
63
- # Logger config
64
- logger:
65
- # Enables client logger
66
- enabled: true
67
- # Enables logger debug mode
68
- debugmode: false
69
- # Enables colored console logs
70
- coloredMessages: true
71
- # File file config
72
- logToFile:
73
- # Enables log file
74
- enabled: true
75
- # Sets the log file folder
76
- logsFolder: './logs'
77
-
78
- # Modules config
79
- modules:
80
- # Reciple modules folders
81
- # You can add multiple folders by adding the folder path or using glob patterns
82
- modulesFolders: ['./modules']
83
- # Excluded files or folders
84
- # You can add the file/folder name or use glob patterns
85
- exclude: []
86
- # If false, the client will still load unsupported modules
87
- disableModuleVersionCheck: false
88
- # Resolve files in modules folder with ".ts" file extension
89
- # This feature is experimental
90
- typescriptModules:
91
- enabled: false
92
- compilerOptions:
93
- target: ESNext
94
- module: NodeNext
95
-
96
- # Discord.js client options
97
- client:
98
- intents:
99
- - 'Guilds'
100
- - 'GuildMessages'
101
- - 'MessageContent'
102
-
103
- # Don't change this value
104
- version: ^VERSION
1
+ # The bot token
2
+ # You can directly set the bot token as value or use token from env
3
+ # To use token from env set the value like this:
4
+ # token: env:TOKEN
5
+ token: TOKEN
6
+
7
+ # Commands Config
8
+ commands:
9
+ contextMenuCommand:
10
+ # If false, the client will ignore this type of command when executed
11
+ enabled: true
12
+ # Enable user command cooldowns if available
13
+ enableCooldown: true
14
+ # Command register config
15
+ registerCommands:
16
+ # Allow commands to be registered globally
17
+ registerGlobally: true
18
+ # Allow commands to be registered a given guilds/servers
19
+ registerToGuilds: []
20
+ # If enabled, the client will accept replied interactions of this type
21
+ acceptRepliedInteractions: false
22
+ slashCommand:
23
+ # If false, the client will ignore this type of command when executed
24
+ enabled: true
25
+ # Enable user command cooldowns if available
26
+ enableCooldown: true
27
+ # Command register config
28
+ registerCommands:
29
+ # Allow commands to be registered globally
30
+ registerGlobally: true
31
+ # Allow commands to be registered a given guilds/servers
32
+ registerToGuilds: []
33
+ # If enabled, the client will accept replied interactions of this type
34
+ acceptRepliedInteractions: false
35
+ messageCommand:
36
+ # If false, the client will ignore this type of command when executed
37
+ enabled: true
38
+ # Enable user command cooldowns if available
39
+ enableCooldown: true
40
+ # String separator for command options
41
+ commandArgumentSeparator: ' '
42
+ # Command prefix
43
+ prefix: '!'
44
+ additionalApplicationCommands:
45
+ # Command register config
46
+ registerCommands:
47
+ # Allow commands to be registered globally
48
+ registerGlobally: true
49
+ # Allow commands to be registered a given guilds/servers
50
+ registerToGuilds: []
51
+
52
+ # Application commands register config
53
+ applicationCommandRegister:
54
+ # Wether allow all application commands to be registered globally
55
+ # This ignores their specific configs
56
+ allowRegisterGlobally: true
57
+ # Wether allow all application commands to be registered to guilds
58
+ # This ignores their specific configs
59
+ allowRegisterOnGuilds: true
60
+ # Register empty command list
61
+ registerEmptyCommands: true
62
+
63
+ # Logger config
64
+ logger:
65
+ # Enables client logger
66
+ enabled: true
67
+ # Enables logger debug mode
68
+ debugmode: false
69
+ # Enables colored console logs
70
+ coloredMessages: true
71
+ # File file config
72
+ logToFile:
73
+ # Enables log file
74
+ enabled: true
75
+ # Sets the log file folder
76
+ logsFolder: './logs'
77
+
78
+ # Modules config
79
+ modules:
80
+ # Reciple modules folders
81
+ # You can add multiple folders by adding the folder path or using glob patterns
82
+ modulesFolders: ['./modules']
83
+ # Excluded files or folders
84
+ # You can add the file/folder name or use glob patterns
85
+ exclude: []
86
+ # If false, the client will still load unsupported modules
87
+ disableModuleVersionCheck: false
88
+ # Resolve files in modules folder with ".ts" file extension
89
+ # This feature is experimental
90
+ typescriptModules:
91
+ enabled: false
92
+ compilerOptions:
93
+ target: ESNext
94
+ module: NodeNext
95
+
96
+ # Discord.js client options
97
+ client:
98
+ intents:
99
+ - 'Guilds'
100
+ - 'GuildMessages'
101
+ - 'MessageContent'
102
+
103
+ # Don't change this value
104
+ version: ^VERSION