reciple 6.0.3 → 7.0.0-dev.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.
- package/LICENSE +674 -674
- package/README.md +193 -182
- package/bin/bin.d.mts +2 -0
- package/bin/bin.mjs +73 -0
- package/bin/bin.mjs.map +1 -0
- package/bin/classes/Config.d.ts +32 -0
- package/bin/classes/Config.js +72 -0
- package/bin/classes/Config.js.map +1 -0
- package/bin/esm.d.mts +1 -0
- package/{dist/lib → bin}/esm.mjs +0 -0
- package/bin/esm.mjs.map +1 -0
- package/bin/index.d.ts +5 -0
- package/bin/index.js +22 -0
- package/bin/index.js.map +1 -0
- package/bin/utils/cli.d.ts +4 -0
- package/bin/utils/cli.js +20 -0
- package/bin/utils/cli.js.map +1 -0
- package/bin/utils/logger.d.ts +6 -0
- package/bin/utils/logger.js +61 -0
- package/bin/utils/logger.js.map +1 -0
- package/bin/utils/modules.d.ts +3 -0
- package/bin/utils/modules.js +35 -0
- package/bin/utils/modules.js.map +1 -0
- package/package.json +26 -66
- package/static/config.yml +97 -0
- package/dist/lib/bin.mjs +0 -77
- package/dist/lib/bin.mjs.map +0 -1
- package/dist/lib/esm.mjs.map +0 -1
- package/dist/lib/index.js +0 -34
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/reciple/classes/RecipleClient.js +0 -293
- package/dist/lib/reciple/classes/RecipleClient.js.map +0 -1
- package/dist/lib/reciple/classes/RecipleConfig.js +0 -107
- package/dist/lib/reciple/classes/RecipleConfig.js.map +0 -1
- package/dist/lib/reciple/classes/RecipleModule.js +0 -137
- package/dist/lib/reciple/classes/RecipleModule.js.map +0 -1
- package/dist/lib/reciple/classes/builders/MessageCommandBuilder.js +0 -316
- package/dist/lib/reciple/classes/builders/MessageCommandBuilder.js.map +0 -1
- package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js +0 -127
- package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js.map +0 -1
- package/dist/lib/reciple/classes/builders/SlashCommandBuilder.js +0 -253
- package/dist/lib/reciple/classes/builders/SlashCommandBuilder.js.map +0 -1
- package/dist/lib/reciple/classes/managers/ApplicationCommandManager.js +0 -179
- package/dist/lib/reciple/classes/managers/ApplicationCommandManager.js.map +0 -1
- package/dist/lib/reciple/classes/managers/CommandCooldownManager.js +0 -100
- package/dist/lib/reciple/classes/managers/CommandCooldownManager.js.map +0 -1
- package/dist/lib/reciple/classes/managers/CommandManager.js +0 -65
- package/dist/lib/reciple/classes/managers/CommandManager.js.map +0 -1
- package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js +0 -26
- package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js.map +0 -1
- package/dist/lib/reciple/classes/managers/ModuleManager.js +0 -181
- package/dist/lib/reciple/classes/managers/ModuleManager.js.map +0 -1
- package/dist/lib/reciple/flags.js +0 -32
- package/dist/lib/reciple/flags.js.map +0 -1
- package/dist/lib/reciple/permissions.js +0 -31
- package/dist/lib/reciple/permissions.js.map +0 -1
- package/dist/lib/reciple/types/builders.js +0 -12
- package/dist/lib/reciple/types/builders.js.map +0 -1
- package/dist/lib/reciple/types/commands.js +0 -16
- package/dist/lib/reciple/types/commands.js.map +0 -1
- package/dist/lib/reciple/types/paramOptions.js +0 -3
- package/dist/lib/reciple/types/paramOptions.js.map +0 -1
- package/dist/lib/reciple/util.js +0 -72
- package/dist/lib/reciple/util.js.map +0 -1
- package/dist/lib/reciple/version.js +0 -48
- package/dist/lib/reciple/version.js.map +0 -1
- package/dist/types/bin.d.mts +0 -3
- package/dist/types/bin.d.mts.map +0 -1
- package/dist/types/esm.d.mts +0 -2
- package/dist/types/esm.d.mts.map +0 -1
- package/dist/types/index.d.ts +0 -18
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/reciple/classes/RecipleClient.d.ts +0 -116
- package/dist/types/reciple/classes/RecipleClient.d.ts.map +0 -1
- package/dist/types/reciple/classes/RecipleConfig.d.ts +0 -102
- package/dist/types/reciple/classes/RecipleConfig.d.ts.map +0 -1
- package/dist/types/reciple/classes/RecipleModule.d.ts +0 -88
- package/dist/types/reciple/classes/RecipleModule.d.ts.map +0 -1
- package/dist/types/reciple/classes/builders/MessageCommandBuilder.d.ts +0 -198
- package/dist/types/reciple/classes/builders/MessageCommandBuilder.d.ts.map +0 -1
- package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts +0 -54
- package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts.map +0 -1
- package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts +0 -107
- package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts.map +0 -1
- package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts +0 -54
- package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts.map +0 -1
- package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts +0 -71
- package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts.map +0 -1
- package/dist/types/reciple/classes/managers/CommandManager.d.ts +0 -35
- package/dist/types/reciple/classes/managers/CommandManager.d.ts.map +0 -1
- package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts +0 -23
- package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts.map +0 -1
- package/dist/types/reciple/classes/managers/ModuleManager.d.ts +0 -50
- package/dist/types/reciple/classes/managers/ModuleManager.d.ts.map +0 -1
- package/dist/types/reciple/flags.d.ts +0 -18
- package/dist/types/reciple/flags.d.ts.map +0 -1
- package/dist/types/reciple/permissions.d.ts +0 -16
- package/dist/types/reciple/permissions.d.ts.map +0 -1
- package/dist/types/reciple/types/builders.d.ts +0 -206
- package/dist/types/reciple/types/builders.d.ts.map +0 -1
- package/dist/types/reciple/types/commands.d.ts +0 -86
- package/dist/types/reciple/types/commands.d.ts.map +0 -1
- package/dist/types/reciple/types/paramOptions.d.ts +0 -102
- package/dist/types/reciple/types/paramOptions.d.ts.map +0 -1
- package/dist/types/reciple/util.d.ts +0 -27
- package/dist/types/reciple/util.d.ts.map +0 -1
- package/dist/types/reciple/version.d.ts +0 -26
- package/dist/types/reciple/version.d.ts.map +0 -1
- package/resource/reciple.yml +0 -122
package/README.md
CHANGED
|
@@ -1,182 +1,193 @@
|
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
.setExecute(
|
|
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
|
-
new
|
|
148
|
-
.setName(
|
|
149
|
-
.setDescription(
|
|
150
|
-
.setCooldown(1000 *
|
|
151
|
-
.setExecute(
|
|
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
|
-
|
|
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
|
+
# 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
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
To install the bot, run the following command in your terminal:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm i reciple discord.js
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
You can initialize the bot to the current directory with the following command in your terminal:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx reciple
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
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.
|
|
46
|
+
|
|
47
|
+
> You can change the token anytime you want
|
|
48
|
+
|
|
49
|
+
## CLI usage
|
|
50
|
+
```yml
|
|
51
|
+
Usage: reciple [options] [cwd]
|
|
52
|
+
|
|
53
|
+
Reciple.js - Discord.js handler cli
|
|
54
|
+
|
|
55
|
+
Arguments:
|
|
56
|
+
cwd Change the current working directory
|
|
57
|
+
|
|
58
|
+
Options:
|
|
59
|
+
-v, --version output the version number
|
|
60
|
+
-t, --token <token> Replace used bot token
|
|
61
|
+
-c, --config <config> Change path to config file
|
|
62
|
+
-D, --debugmode Enable debug mode
|
|
63
|
+
-y, --yes Agree to all Reciple confirmation prompts
|
|
64
|
+
--env .env file location
|
|
65
|
+
-h, --help display help for command
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Message Commands
|
|
69
|
+
|
|
70
|
+
Reciple provides built-in `MessageCommandBuilder` class that can be used for message command handler.
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
const { MessageCommandBuilder } = require('reciple');
|
|
74
|
+
|
|
75
|
+
new MessageCommandBuilder()
|
|
76
|
+
.setName("command")
|
|
77
|
+
.setDescription("Your lil tiny description")
|
|
78
|
+
.addAliases('cmd', 'cmd1')
|
|
79
|
+
.setExecute(command => command.message.reply("Hello!"))
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Validate Message Command Options
|
|
83
|
+
|
|
84
|
+
```js
|
|
85
|
+
const { MessageCommandBuilder } = require('reciple');
|
|
86
|
+
|
|
87
|
+
new MessageCommandBuilder()
|
|
88
|
+
.setName("command")
|
|
89
|
+
.setDescription("Your lil tiny description")
|
|
90
|
+
.addAliases('cmd', 'cmd1')
|
|
91
|
+
.setValidateOptions(true) // Validate options
|
|
92
|
+
.addOption(option => option
|
|
93
|
+
.setName("quantity")
|
|
94
|
+
.setDescription("Must be a number")
|
|
95
|
+
.setRequired(true) // A required option
|
|
96
|
+
.setValidator(val => !isNaN(Number(val))) // Validate value
|
|
97
|
+
)
|
|
98
|
+
.setExecute(async command => {
|
|
99
|
+
const quantity = Number(command.options.getValue('quantity', true));
|
|
100
|
+
|
|
101
|
+
await command.message.reply("Quantity: " + quantity);
|
|
102
|
+
})
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Context Menus
|
|
106
|
+
|
|
107
|
+
Reciple provides custom `ContextMenuBuilder` class that can be used for context menu command handler.
|
|
108
|
+
|
|
109
|
+
```js
|
|
110
|
+
const { ContextMenuBuilder } = require('reciple');
|
|
111
|
+
const { ApplicationCommandType } = require('discord.js');
|
|
112
|
+
|
|
113
|
+
new ContextMenuBuilder()
|
|
114
|
+
.setName('Ban')
|
|
115
|
+
.setType(ApplicationCommandType.User)
|
|
116
|
+
.setExecute(async ({ interaction }) => {
|
|
117
|
+
if (!interaction.inCachedGuild()) return;
|
|
118
|
+
await interaction.member.ban();
|
|
119
|
+
})
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Slash Commands
|
|
123
|
+
|
|
124
|
+
Reciple provides custom `SlashCommandBuilder` class that can be used for slash command handler.
|
|
125
|
+
|
|
126
|
+
```js
|
|
127
|
+
const { SlashCommandBuilder } = require('reciple');
|
|
128
|
+
|
|
129
|
+
new SlashCommandBuilder()
|
|
130
|
+
.setName('ping')
|
|
131
|
+
.setDescription('Pong')
|
|
132
|
+
.setExecute(async ({ interaction }) => interaction.reply(`Pong!`))
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Command Cooldowns
|
|
136
|
+
|
|
137
|
+
```js
|
|
138
|
+
const { MessageCommandBuilder, MessageCommandBuilder, SlashCommandBuilder } = require('reciple');
|
|
139
|
+
const { ApplicationCommandType } = require('discord.js');
|
|
140
|
+
|
|
141
|
+
new ContextMenuCommandBuilder()
|
|
142
|
+
.setName('Context Menu')
|
|
143
|
+
.setType(ApplicationCommandType.Message)
|
|
144
|
+
.setCooldown(1000 * 5) // 5 seconds cooldown
|
|
145
|
+
.setExecute(async ({ interaction }) => interaction.reply(`Hello!`));
|
|
146
|
+
|
|
147
|
+
new ContextMenuCommandBuilder()
|
|
148
|
+
.setName('message-command')
|
|
149
|
+
.setDescription(`Your command`)
|
|
150
|
+
.setCooldown(1000 * 5) // 5 seconds cooldown
|
|
151
|
+
.setExecute(async ({ message }) => message.reply(`Hello!`));
|
|
152
|
+
|
|
153
|
+
new SlashCommandBuilder()
|
|
154
|
+
.setName('slash-command')
|
|
155
|
+
.setDescription(`Your command`)
|
|
156
|
+
.setCooldown(1000 * 5) // 5 seconds cooldown
|
|
157
|
+
.setExecute(async ({ interaction }) => interaction.reply(`Hello!`));
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Config
|
|
161
|
+
|
|
162
|
+
You can configure the bot in `reciple.yml` located in the bot's root directory.
|
|
163
|
+
|
|
164
|
+
### Token
|
|
165
|
+
|
|
166
|
+
You can directly change the token in `reciple.yml`.
|
|
167
|
+
|
|
168
|
+
```yml
|
|
169
|
+
token: "YOUR_TOKEN_HERE"
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Using environment variables is also supported.
|
|
173
|
+
|
|
174
|
+
```yml
|
|
175
|
+
token: "env:TOKEN_VARIABLE"
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
You can override the given token using your terminal
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
npx reciple --token "YOUR_TOKEN_HERE"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Use env variable
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
npx reciple --token "env:TOKEN_VARIABLE"
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
***
|
|
191
|
+
|
|
192
|
+
> ## Fun Fact
|
|
193
|
+
> 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/bin/bin.d.mts
ADDED
package/bin/bin.mjs
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync, mkdirSync, readdirSync } from 'fs';
|
|
3
|
+
import { flags, cwd } from './utils/cli.js';
|
|
4
|
+
import { path } from 'fallout-utility';
|
|
5
|
+
import micromatch from 'micromatch';
|
|
6
|
+
import promptConfirm from '@inquirer/confirm';
|
|
7
|
+
import { Config } from './classes/Config.js';
|
|
8
|
+
import { ContextMenuCommandBuilder, MessageCommandBuilder, RecipleClient, SlashCommandBuilder, realVersion } from '@reciple/client';
|
|
9
|
+
import { createLogger, eventLogger } from './utils/logger.js';
|
|
10
|
+
import { getModules } from './utils/modules.js';
|
|
11
|
+
const allowedFiles = ['node_modules', 'reciple.yml', 'package.json', '.*'];
|
|
12
|
+
const configPath = flags.config ?? path.join(cwd, 'reciple.yml');
|
|
13
|
+
if (!existsSync(cwd))
|
|
14
|
+
mkdirSync(cwd, { recursive: true });
|
|
15
|
+
if (readdirSync(cwd).filter(f => !micromatch.isMatch(f, allowedFiles)).length && !existsSync(configPath) && !flags.yes) {
|
|
16
|
+
const confirm = await promptConfirm({
|
|
17
|
+
default: false,
|
|
18
|
+
message: 'Would you like to create Reciple config here?'
|
|
19
|
+
});
|
|
20
|
+
if (!confirm)
|
|
21
|
+
process.exit(0);
|
|
22
|
+
}
|
|
23
|
+
const configParser = await (new Config(configPath)).parseConfig();
|
|
24
|
+
const config = configParser.getConfig();
|
|
25
|
+
const client = new RecipleClient({
|
|
26
|
+
recipleOptions: config,
|
|
27
|
+
...config.client,
|
|
28
|
+
logger: config.logger.enabled ? createLogger(config.logger) : undefined
|
|
29
|
+
});
|
|
30
|
+
client.logger?.info(`Starting Reciple client v${realVersion} - ${new Date()}`);
|
|
31
|
+
eventLogger(client);
|
|
32
|
+
await client.modules.startModules({
|
|
33
|
+
modules: await client.modules.resolveModuleFiles(await getModules(config.modules, file => file.endsWith('.js') || file.endsWith('.mjs') || file.endsWith('.cjs')), config.modules.disableModuleVersionCheck),
|
|
34
|
+
addToModulesCollection: true
|
|
35
|
+
});
|
|
36
|
+
client.once('ready', async () => {
|
|
37
|
+
const loadedModules = await client.modules.loadModules({
|
|
38
|
+
modules: client.modules.modules.toJSON(),
|
|
39
|
+
resolveCommands: true
|
|
40
|
+
});
|
|
41
|
+
client.modules.modules.sweep(m => !loadedModules.some(s => s.id == m.id));
|
|
42
|
+
const unloadModulesAndStopProcess = async (signal) => {
|
|
43
|
+
await client.modules.unloadModules({
|
|
44
|
+
reason: 'ProcessExit',
|
|
45
|
+
modules: client.modules.modules.toJSON(),
|
|
46
|
+
removeCommandsFromClient: false,
|
|
47
|
+
removeFromModulesCollection: true
|
|
48
|
+
});
|
|
49
|
+
client.logger?.warn(`Process exited: ${signal === 'SIGINT' ? 'keyboard interrupt' : signal === 'SIGTERM' ? 'terminate' : signal}`);
|
|
50
|
+
process.exit();
|
|
51
|
+
};
|
|
52
|
+
process.once('SIGINT', signal => unloadModulesAndStopProcess(signal));
|
|
53
|
+
process.once('SIGTERM', signal => unloadModulesAndStopProcess(signal));
|
|
54
|
+
client.on('cacheSweep', () => client.cooldowns.clean());
|
|
55
|
+
await client.commands.registerApplicationCommands();
|
|
56
|
+
client.logger?.warn(`Logged in as ${client.user?.tag} (${client.user?.id})`);
|
|
57
|
+
client.logger?.log(`Loaded ${client.commands.contextMenuCommands.size} context menu commands`);
|
|
58
|
+
client.logger?.log(`Loaded ${client.commands.messageCommands.size} message commands`);
|
|
59
|
+
client.logger?.log(`Loaded ${client.commands.slashCommands.size} slash commands`);
|
|
60
|
+
client.on('interactionCreate', interaction => {
|
|
61
|
+
if (interaction.isContextMenuCommand()) {
|
|
62
|
+
ContextMenuCommandBuilder.execute(client, interaction);
|
|
63
|
+
}
|
|
64
|
+
else if (interaction.isChatInputCommand()) {
|
|
65
|
+
SlashCommandBuilder.execute(client, interaction);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
client.on('messageCreate', message => {
|
|
69
|
+
MessageCommandBuilder.execute(client, message);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
client.login(config.token);
|
|
73
|
+
//# sourceMappingURL=bin.mjs.map
|
package/bin/bin.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.mjs","sourceRoot":"","sources":["../src/bin.mts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACpI,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,YAAY,GAAG,CAAC,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;AAC3E,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;AAEjE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;IAAE,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EA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AC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { RecipleConfigOptions } from '@reciple/client';
|
|
2
|
+
import { ClientOptions } from 'discord.js';
|
|
3
|
+
export interface IConfig extends RecipleConfigOptions {
|
|
4
|
+
logger: {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
debugmode: boolean;
|
|
7
|
+
coloredMessages: boolean;
|
|
8
|
+
logToFile: {
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
logsFolder: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
modules: {
|
|
14
|
+
modulesFolders: string[];
|
|
15
|
+
exclude: string[];
|
|
16
|
+
disableModuleVersionCheck: boolean;
|
|
17
|
+
};
|
|
18
|
+
client: ClientOptions;
|
|
19
|
+
version: string;
|
|
20
|
+
}
|
|
21
|
+
export declare class Config {
|
|
22
|
+
static defaultConfigPath: string;
|
|
23
|
+
config: IConfig | null;
|
|
24
|
+
readonly configPath: string;
|
|
25
|
+
constructor(configPath: string);
|
|
26
|
+
parseConfig(): Promise<this>;
|
|
27
|
+
getConfig(): IConfig;
|
|
28
|
+
askToken(): Promise<string>;
|
|
29
|
+
parseToken(): string | null;
|
|
30
|
+
static defaultConfig(): IConfig;
|
|
31
|
+
static defaultConfigYaml(): string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Config = void 0;
|
|
7
|
+
const client_1 = require("@reciple/client");
|
|
8
|
+
const fallout_utility_1 = require("fallout-utility");
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const yaml_1 = __importDefault(require("yaml"));
|
|
11
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
12
|
+
const cli_1 = require("../utils/cli");
|
|
13
|
+
dotenv_1.default.config({
|
|
14
|
+
path: cli_1.flags.env ? fallout_utility_1.path.resolve(cli_1.flags.env) : fallout_utility_1.path.join(cli_1.cwd, '.env')
|
|
15
|
+
});
|
|
16
|
+
class Config {
|
|
17
|
+
static defaultConfigPath = fallout_utility_1.path.join(__dirname, '../../static/config.yml');
|
|
18
|
+
config = null;
|
|
19
|
+
configPath;
|
|
20
|
+
constructor(configPath) {
|
|
21
|
+
if (!configPath)
|
|
22
|
+
throw new Error('Config path is not defined');
|
|
23
|
+
this.configPath = configPath;
|
|
24
|
+
}
|
|
25
|
+
async parseConfig() {
|
|
26
|
+
if (!(0, fs_1.existsSync)(this.configPath)) {
|
|
27
|
+
let configYaml = (0, fallout_utility_1.replaceAll)(Config.defaultConfigYaml(), 'VERSION', client_1.version);
|
|
28
|
+
let configData = yaml_1.default.parse(configYaml);
|
|
29
|
+
if (configData.token === 'TOKEN') {
|
|
30
|
+
configData.token = await this.askToken() || 'TOKEN';
|
|
31
|
+
configYaml = (0, fallout_utility_1.replaceAll)(configYaml, 'token: TOKEN', `token: ${configData.token}`);
|
|
32
|
+
}
|
|
33
|
+
(0, fs_1.writeFileSync)(this.configPath, configYaml, 'utf-8');
|
|
34
|
+
this.config = configData;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
this.config = yaml_1.default.parse((0, fs_1.readFileSync)(this.configPath, 'utf-8'));
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
getConfig() {
|
|
41
|
+
if (!this.config)
|
|
42
|
+
throw new Error(`Config is not parsed`);
|
|
43
|
+
this.config.token = this.parseToken() || 'TOKEN';
|
|
44
|
+
return this.config;
|
|
45
|
+
}
|
|
46
|
+
async askToken() {
|
|
47
|
+
return (await import('@inquirer/password')).default({
|
|
48
|
+
message: `Bot token`,
|
|
49
|
+
mask: '*',
|
|
50
|
+
validate: value => !value.length ? 'Enter a valid bot token' : true
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
parseToken() {
|
|
54
|
+
let token = cli_1.flags.token || this.config?.token || null;
|
|
55
|
+
if (!token)
|
|
56
|
+
return token;
|
|
57
|
+
const env = String(token).split(':');
|
|
58
|
+
if (env.length !== 2 || env[0].toLowerCase() !== 'env')
|
|
59
|
+
return token;
|
|
60
|
+
return process.env[env[1]] ?? null;
|
|
61
|
+
}
|
|
62
|
+
static defaultConfig() {
|
|
63
|
+
return yaml_1.default.parse(this.defaultConfigYaml());
|
|
64
|
+
}
|
|
65
|
+
static defaultConfigYaml() {
|
|
66
|
+
if (!(0, fs_1.existsSync)(this.defaultConfigPath))
|
|
67
|
+
throw new Error(`Default config file does not exists: ${this.defaultConfigPath}`);
|
|
68
|
+
return (0, fs_1.readFileSync)(this.defaultConfigPath, 'utf-8');
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.Config = Config;
|
|
72
|
+
//# sourceMappingURL=Config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/classes/Config.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAgE;AAChE,qDAAmD;AACnD,2BAA6D;AAE7D,gDAAuB;AACvB,oDAA4B;AAC5B,sCAA0C;AAE1C,gBAAM,CAAC,MAAM,CAAC;IACV,IAAI,EAAE,WAAK,CAAC,GAAG,CAAC,CAAC,CAAC,sBAAI,CAAC,OAAO,CAAC,WAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,sBAAI,CAAC,IAAI,CAAC,SAAG,EAAE,MAAM,CAAC;CACrE,CAAC,CAAC;AAqBH,MAAa,MAAM;IACR,MAAM,CAAC,iBAAiB,GAAW,sBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;IACnF,MAAM,GAAiB,IAAI,CAAC;IAC1B,UAAU,CAAS;IAE5B,YAAY,UAAkB;QAC1B,IAAI,CAAC,UAAU;YAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,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;YACpB,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,IAAI;SACtE,CAAC,CAAC;IACP,CAAC;IAEM,UAAU;QACb,IAAI,KAAK,GAAG,WAAK,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,IAAI,CAAC;QACtD,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QAEzB,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK;YAAE,OAAO,KAAK,CAAC;QAErE,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IACvC,CAAC;IAEM,MAAM,CAAC,aAAa;QACvB,OAAO,cAAG,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAC/C,CAAC;IAEM,MAAM,CAAC,iBAAiB;QAC3B,IAAI,CAAC,IAAA,eAAU,EAAC,IAAI,CAAC,iBAAiB,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAC3H,OAAO,IAAA,iBAAY,EAAC,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;;AA/DL,wBAgEC"}
|
package/bin/esm.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index.js';
|
package/{dist/lib → bin}/esm.mjs
RENAMED
|
File without changes
|
package/bin/esm.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esm.mjs","sourceRoot":"","sources":["../src/esm.mts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
package/bin/index.d.ts
ADDED
package/bin/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
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/client"), exports);
|
|
18
|
+
__exportStar(require("./classes/Config"), exports);
|
|
19
|
+
__exportStar(require("./utils/cli"), exports);
|
|
20
|
+
__exportStar(require("./utils/logger"), exports);
|
|
21
|
+
__exportStar(require("./utils/modules"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
package/bin/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,mDAAiC;AACjC,8CAA4B;AAC5B,iDAA+B;AAC/B,kDAAgC"}
|
package/bin/utils/cli.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cwd = exports.flags = exports.command = void 0;
|
|
4
|
+
const client_1 = require("@reciple/client");
|
|
5
|
+
const commander_1 = require("commander");
|
|
6
|
+
const fallout_utility_1 = require("fallout-utility");
|
|
7
|
+
exports.command = new commander_1.Command()
|
|
8
|
+
.name('reciple')
|
|
9
|
+
.description('Reciple.js - Discord.js handler cli')
|
|
10
|
+
.version(`v${client_1.realVersion}`, '-v, --version')
|
|
11
|
+
.argument('[cwd]', 'Change the current working directory')
|
|
12
|
+
.option('-t, --token <token>', 'Replace used bot token')
|
|
13
|
+
.option('-c, --config <config>', 'Change path to config file')
|
|
14
|
+
.option('-D, --debugmode', 'Enable debug mode')
|
|
15
|
+
.option('-y, --yes', 'Agree to all Reciple confirmation prompts')
|
|
16
|
+
.option('--env', '.env file location')
|
|
17
|
+
.parse();
|
|
18
|
+
exports.flags = exports.command.opts();
|
|
19
|
+
exports.cwd = exports.command.args[0] ? fallout_utility_1.path.resolve(exports.command.args[0]) : process.cwd();
|
|
20
|
+
//# sourceMappingURL=cli.js.map
|