reciple 7.0.13 → 7.1.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/LICENSE +674 -674
- package/README.md +211 -211
- package/bin/bin.mjs +4 -4
- package/bin/bin.mjs.map +1 -1
- package/bin/classes/Config.d.ts +5 -1
- package/bin/classes/Config.js +3 -2
- package/bin/classes/Config.js.map +1 -1
- package/bin/utils/cli.js +6 -3
- package/bin/utils/cli.js.map +1 -1
- package/bin/utils/logger.js +2 -1
- package/bin/utils/logger.js.map +1 -1
- package/bin/utils/modules.d.ts +2 -1
- package/bin/utils/modules.js +11 -11
- package/bin/utils/modules.js.map +1 -1
- package/package.json +6 -6
- package/static/config.yml +104 -100
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/bin/bin.mjs
CHANGED
|
@@ -6,10 +6,10 @@ import { existsSync, mkdirSync, readdirSync } from 'fs';
|
|
|
6
6
|
import { Config } from './classes/Config.js';
|
|
7
7
|
import { flags, cwd } from './utils/cli.js';
|
|
8
8
|
import { RecipleClient } from './index.js';
|
|
9
|
-
import { path } from 'fallout-utility';
|
|
10
9
|
import micromatch from 'micromatch';
|
|
11
10
|
import prompts from 'prompts';
|
|
12
11
|
import semver from 'semver';
|
|
12
|
+
import path from 'path';
|
|
13
13
|
const allowedFiles = ['node_modules', 'reciple.yml', 'package.json', '.*'];
|
|
14
14
|
const configPath = flags.config
|
|
15
15
|
? path.isAbsolute(flags.config)
|
|
@@ -42,12 +42,12 @@ const client = new RecipleClient({
|
|
|
42
42
|
});
|
|
43
43
|
client.logger?.info(`Starting Reciple client v${realVersion} - ${new Date()}`);
|
|
44
44
|
eventLogger(client);
|
|
45
|
-
const moduleFilesFilter = (file) => file.endsWith('.js') || file.endsWith('.
|
|
45
|
+
const moduleFilesFilter = (file) => file.endsWith('.js') || file.endsWith('.cjs') || file.endsWith('.mjs') || ((flags.ts || config.modules?.typescriptModules?.enabled) ? (file.endsWith('.ts') || file.endsWith('.cts') || file.endsWith('.mts')) : false);
|
|
46
46
|
await client.modules.startModules({
|
|
47
47
|
modules: await client.modules.resolveModuleFiles(await getModules(config.modules, (f) => moduleFilesFilter(f)), config.modules.disableModuleVersionCheck, async (filePath) => {
|
|
48
|
-
if (!filePath.endsWith('.ts'))
|
|
48
|
+
if (!(filePath.endsWith('.ts') || filePath.endsWith('.cts') || filePath.endsWith('.mts')))
|
|
49
49
|
return undefined;
|
|
50
|
-
return requireTypescriptFile(filePath);
|
|
50
|
+
return requireTypescriptFile(filePath, config.modules?.typescriptModules?.compilerOptions);
|
|
51
51
|
}),
|
|
52
52
|
addToModulesCollection: true
|
|
53
53
|
});
|
package/bin/bin.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.mjs","sourceRoot":"","sources":["../src/bin.mts"],"names":[],"mappings":";AAEA,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC9H,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAA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@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RecipleConfigOptions } from '@reciple/client';
|
|
2
2
|
import { ClientOptions } from 'discord.js';
|
|
3
|
+
import { TranspileOptions } from 'typescript';
|
|
3
4
|
export interface IConfig extends RecipleConfigOptions {
|
|
4
5
|
logger: {
|
|
5
6
|
enabled: boolean;
|
|
@@ -17,7 +18,10 @@ export interface IConfig extends RecipleConfigOptions {
|
|
|
17
18
|
/**
|
|
18
19
|
* @experimental
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
|
+
typescriptModules: {
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
compilerOptions?: Partial<TranspileOptions['compilerOptions']>;
|
|
24
|
+
};
|
|
21
25
|
};
|
|
22
26
|
client: ClientOptions;
|
|
23
27
|
version: string;
|
package/bin/classes/Config.js
CHANGED
|
@@ -10,11 +10,12 @@ const fs_1 = require("fs");
|
|
|
10
10
|
const yaml_1 = __importDefault(require("yaml"));
|
|
11
11
|
const dotenv_1 = __importDefault(require("dotenv"));
|
|
12
12
|
const cli_1 = require("../utils/cli");
|
|
13
|
+
const path_1 = __importDefault(require("path"));
|
|
13
14
|
dotenv_1.default.config({
|
|
14
|
-
path: cli_1.flags.env ?
|
|
15
|
+
path: cli_1.flags.env ? path_1.default.resolve(cli_1.flags.env) : path_1.default.join(cli_1.cwd, '.env')
|
|
15
16
|
});
|
|
16
17
|
class Config {
|
|
17
|
-
static defaultConfigPath =
|
|
18
|
+
static defaultConfigPath = path_1.default.join(__dirname, '../../static/config.yml');
|
|
18
19
|
config = null;
|
|
19
20
|
configPath;
|
|
20
21
|
constructor(configPath) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/classes/Config.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAgE;AAChE,
|
|
1
|
+
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/classes/Config.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAgE;AAChE,qDA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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;;AAjEL,wBAkEC"}
|
package/bin/utils/cli.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.cwd = exports.flags = exports.command = void 0;
|
|
4
7
|
const client_1 = require("@reciple/client");
|
|
5
8
|
const commander_1 = require("commander");
|
|
6
|
-
const fallout_utility_1 = require("fallout-utility");
|
|
7
9
|
const fs_1 = require("fs");
|
|
8
|
-
const
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const { version } = JSON.parse((0, fs_1.readFileSync)(path_1.default.join(__dirname, '../../package.json'), 'utf-8'));
|
|
9
12
|
exports.command = new commander_1.Command()
|
|
10
13
|
.name('reciple')
|
|
11
14
|
.description('Reciple.js - Discord.js handler cli')
|
|
@@ -20,5 +23,5 @@ exports.command = new commander_1.Command()
|
|
|
20
23
|
.allowUnknownOption(true)
|
|
21
24
|
.parse();
|
|
22
25
|
exports.flags = exports.command.opts();
|
|
23
|
-
exports.cwd = exports.command.args[0] ?
|
|
26
|
+
exports.cwd = exports.command.args[0] ? path_1.default.resolve(exports.command.args[0]) : process.cwd();
|
|
24
27
|
//# sourceMappingURL=cli.js.map
|
package/bin/utils/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/utils/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/utils/cli.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA8C;AAC9C,yCAAoC;AACpC,2BAAkC;AAClC,gDAAwB;AAExB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAErF,QAAA,OAAO,GAAG,IAAI,mBAAO,EAAE;KAC/B,IAAI,CAAC,SAAS,CAAC;KACf,WAAW,CAAC,qCAAqC,CAAC;KAClD,OAAO,CAAC,gBAAgB,OAAO,qBAAqB,oBAAW,EAAE,EAAE,eAAe,CAAC;KACnF,QAAQ,CAAC,OAAO,EAAE,sCAAsC,CAAC;KACzD,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC;KACvD,MAAM,CAAC,oBAAoB,EAAE,4BAA4B,CAAC;KAC1D,MAAM,CAAC,iBAAiB,EAAE,mBAAmB,CAAC;KAC9C,MAAM,CAAC,WAAW,EAAE,2CAA2C,CAAC;KAChE,MAAM,CAAC,OAAO,EAAE,oBAAoB,CAAC;KACrC,MAAM,CAAC,MAAM,EAAE,0DAA0D,CAAC;KAC1E,kBAAkB,CAAC,IAAI,CAAC;KACxB,KAAK,EAAE,CAAC;AAEA,QAAA,KAAK,GAAG,eAAO,CAAC,IAAI,EAAE,CAAC;AACvB,QAAA,GAAG,GAAG,eAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAI,CAAC,OAAO,CAAC,eAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC"}
|
package/bin/utils/logger.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.eventLogger = exports.createLogger = exports.formatLogMessage = void 0;
|
|
|
7
7
|
const fallout_utility_1 = require("fallout-utility");
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
9
|
const cli_1 = require("./cli");
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
10
11
|
function formatLogMessage(message, logger, config, level) {
|
|
11
12
|
const color = (msg) => {
|
|
12
13
|
if (!config.coloredMessages || level === fallout_utility_1.LoggerLevel.INFO)
|
|
@@ -38,7 +39,7 @@ function createLogger(config) {
|
|
|
38
39
|
}
|
|
39
40
|
});
|
|
40
41
|
if (config.logToFile.enabled)
|
|
41
|
-
logger.logToFile(
|
|
42
|
+
logger.logToFile(path_1.default.join(cli_1.cwd, config.logToFile.logsFolder, 'latest.log'));
|
|
42
43
|
return logger;
|
|
43
44
|
}
|
|
44
45
|
exports.createLogger = createLogger;
|
package/bin/utils/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":";;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":";;;;;;AACA,qDAAsD;AAGtD,kDAA0B;AAC1B,+BAA4B;AAC5B,gDAAwB;AAExB,SAAgB,gBAAgB,CAAC,OAAe,EAAE,MAAc,EAAE,MAAyB,EAAE,KAAkB;IAC3G,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,EAAE;QAC1B,IAAI,CAAC,MAAM,CAAC,eAAe,IAAI,KAAK,KAAK,6BAAW,CAAC,IAAI;YAAE,OAAO,GAAG,CAAC;QAEtE,QAAQ,KAAK,EAAE;YACX,KAAK,6BAAW,CAAC,IAAI;gBACjB,OAAO,eAAK,CAAC,MAAM,CAAC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AE,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,4CAA4C,OAAO,CAAC,WAAW,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAExJ,MAAM,CAAC,EAAE,CAAC,oCAAoC,EAAE,CAAC,QAAgD,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,eAAe,QAAQ,EAAE,IAAI,IAAI,CAAC,0BAA0B,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;AACvO,CAAC;AAnBD,kCAmBC"}
|
package/bin/utils/modules.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Awaitable } from 'fallout-utility';
|
|
2
2
|
import { IConfig } from '../classes/Config';
|
|
3
|
+
import { TranspileOptions } from 'typescript';
|
|
3
4
|
export declare function getModules(config: IConfig['modules'], filter?: (filename: string) => Awaitable<boolean>): Promise<string[]>;
|
|
4
|
-
export declare function requireTypescriptFile(file: string): Promise<any>;
|
|
5
|
+
export declare function requireTypescriptFile(file: string, compilerOptions?: Partial<TranspileOptions['compilerOptions']>): Promise<any>;
|