create-reciple 9.0.0-dev.11 → 9.0.0-dev.12
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/README.md +2 -2
- package/assets/README.md +15 -176
- package/dist/utils/addons.js +2 -4
- package/dist/utils/addons.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
<a href="https://github.com/thenorthsolution/Reciple/tree/main/packages/create-reciple">
|
|
14
14
|
<img src="https://img.shields.io/npm/dt/create-reciple?maxAge=3600">
|
|
15
15
|
</a>
|
|
16
|
-
<a href="https://www.codefactor.io/repository/github/
|
|
17
|
-
<img src="https://www.codefactor.io/repository/github/
|
|
16
|
+
<a href="https://www.codefactor.io/repository/github/thenorthsolution/reciple">
|
|
17
|
+
<img src="https://www.codefactor.io/repository/github/thenorthsolution/reciple/badge">
|
|
18
18
|
</a>
|
|
19
19
|
<br>
|
|
20
20
|
<div style="padding-top: 1rem">
|
package/assets/README.md
CHANGED
|
@@ -1,190 +1,29 @@
|
|
|
1
1
|
# Reciple App
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This project is generated with [`create-reciple`](https://npmjs.org/package/create-reciple)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Developing
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Set your Discord token in `.env` file located in your bot's root directory.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Module System
|
|
14
|
-
|
|
15
|
-
With Reciple a module can be a command, event, or anything. Reciple scans the dirs given from the config and loads every valid javascript files in that folder.
|
|
16
|
-
|
|
17
|
-
### File Structure
|
|
18
|
-
|
|
19
|
-
```js
|
|
20
|
-
// Module config (reciple.mjs)
|
|
21
|
-
export const config = {
|
|
22
|
-
// other things
|
|
23
|
-
modules: {
|
|
24
|
-
dirs: ['./modules'], // scans the modules folder
|
|
25
|
-
exclude: [],
|
|
26
|
-
filter: file => true,
|
|
27
|
-
disableModuleVersionCheck: false
|
|
28
|
-
},
|
|
29
|
-
// other things
|
|
30
|
-
};
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
> Folder structure
|
|
35
|
-
|
|
36
|
-
reciple.mjs
|
|
37
|
-
package.json
|
|
38
|
-
node_modules/
|
|
39
|
-
modules/
|
|
40
|
-
├─ module1.js
|
|
41
|
-
├─ module2.js
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
You can also use a glob pattern for your dir config.
|
|
45
|
-
|
|
46
|
-
```js
|
|
47
|
-
// Module config (reciple.mjs)
|
|
48
|
-
export const config = {
|
|
49
|
-
// other things
|
|
50
|
-
modules: {
|
|
51
|
-
dirs: ['./modules/**/*'], // scans the modules folder and every folders in it recursively
|
|
52
|
-
exclude: [],
|
|
53
|
-
filter: file => true,
|
|
54
|
-
disableModuleVersionCheck: false
|
|
55
|
-
},
|
|
56
|
-
// other things
|
|
57
|
-
};
|
|
9
|
+
```properties
|
|
10
|
+
# Replace this value to your Discord bot token from https://discord.com/developers/applications
|
|
11
|
+
TOKEN=""
|
|
58
12
|
```
|
|
59
13
|
|
|
60
|
-
|
|
61
|
-
> Folder structure
|
|
14
|
+
To start your bot in watch mode, run:
|
|
62
15
|
|
|
63
|
-
reciple.mjs
|
|
64
|
-
package.json
|
|
65
|
-
node_modules/
|
|
66
|
-
modules/
|
|
67
|
-
├─ module1.js
|
|
68
|
-
├─ module2.js
|
|
69
|
-
├─anotherFolder/
|
|
70
|
-
├─ module1.js
|
|
71
|
-
├─ module2.js
|
|
72
16
|
```
|
|
73
|
-
|
|
74
|
-
### Module Structure
|
|
75
|
-
|
|
76
|
-
Reciple can load CommonJs and ESM modules at the same time.
|
|
77
|
-
|
|
78
|
-
#### Valid File Types
|
|
79
|
-
- `.js`
|
|
80
|
-
- `.cjs`
|
|
81
|
-
- `.mjs`
|
|
82
|
-
|
|
83
|
-
#### Module Files
|
|
84
|
-
|
|
85
|
-
```js
|
|
86
|
-
// ESM
|
|
87
|
-
export default {
|
|
88
|
-
versions: ['^9'],
|
|
89
|
-
onStart: async ({ client }) => true, // Always return true if the module is loaded
|
|
90
|
-
onLoad: async ({ client }) => {},
|
|
91
|
-
onUnload: async ({ client }) => {}
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
// CJS
|
|
95
|
-
module.exports = {
|
|
96
|
-
versions: ['^9'],
|
|
97
|
-
onStart: async ({ client }) => true, // Always return true if the module is loaded
|
|
98
|
-
onLoad: async ({ client }) => {},
|
|
99
|
-
onUnload: async ({ client }) => {}
|
|
100
|
-
};
|
|
17
|
+
npm run dev
|
|
101
18
|
```
|
|
102
19
|
|
|
103
|
-
|
|
104
|
-
```js
|
|
105
|
-
|
|
106
|
-
// ESM
|
|
107
|
-
export class MyModule {
|
|
108
|
-
versions = ['^9'];
|
|
20
|
+
To start your bot for production your can use `npm run start`.
|
|
109
21
|
|
|
110
|
-
|
|
111
|
-
return true; // Always return true if the module is loaded
|
|
112
|
-
}
|
|
22
|
+
> Note: You need to have Node.js v18+ installed.
|
|
113
23
|
|
|
114
|
-
|
|
115
|
-
async onUnload({ client }) {}
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export default new MyModule();
|
|
119
|
-
|
|
120
|
-
// CJS
|
|
121
|
-
class MyModule {
|
|
122
|
-
versions = ['^9'];
|
|
123
|
-
|
|
124
|
-
async onStart({ client }) {
|
|
125
|
-
return true; // Always return true if the module is loaded
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
async onLoad({ client }) {}
|
|
129
|
-
async onUnload({ client }) {}
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
module.exports = new MyModule();
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
## Adding Commands
|
|
136
|
-
|
|
137
|
-
To add commands to your module, simply add `commands` propery to your module.
|
|
138
|
-
|
|
139
|
-
```js
|
|
140
|
-
export default {
|
|
141
|
-
versions: ['^9'],
|
|
142
|
-
commands: [], // Commands goes here
|
|
143
|
-
onStart: async ({ client }) => true, // Always return true if the module is loaded
|
|
144
|
-
onLoad: async ({ client }) => {},
|
|
145
|
-
onUnload: async ({ client }) => {}
|
|
146
|
-
};
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
Instead of importing command builders from Discord.js, use the command builders provided by Reciple.
|
|
150
|
-
|
|
151
|
-
```diff
|
|
152
|
-
// ESM
|
|
153
|
-
- import { ContextMenuCommandBuilder, SlashCommandBuilder } from 'discord.js';
|
|
154
|
-
+ import { ContextMenuCommandBuilder, SlashCommandBuilder } from 'reciple';
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
```diff
|
|
158
|
-
// CJS
|
|
159
|
-
- const { ContextMenuCommandBuilder, SlashCommandBuilder } = require('discord.js');
|
|
160
|
-
+ const { ContextMenuCommandBuilder, SlashCommandBuilder } = require('reciple');
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
Just create a new instance of a command builder in the commands array to add commands to a module.
|
|
164
|
-
|
|
165
|
-
```js
|
|
166
|
-
import { ContextMenuCommandBuilder, MessageCommandBuilder, SlashCommandBuilder } from 'reciple';
|
|
167
|
-
|
|
168
|
-
export default {
|
|
169
|
-
versions: ['^9'],
|
|
170
|
-
commands: [
|
|
171
|
-
new ContextMenuCommandBuilder()
|
|
172
|
-
.setName('To Lowercase')
|
|
173
|
-
.setType('Message')
|
|
174
|
-
.setExecute(async ({ interaction }) => interaction.reply(interaction.targetMessage.content.toLowercase())),
|
|
175
|
-
new MessageCommandBuilder()
|
|
176
|
-
.setName('hi')
|
|
177
|
-
.setDescript('Say hello')
|
|
178
|
-
.setExecute(async ({ message }) => message.reply('hello')),
|
|
179
|
-
new SlashCommandBuilder()
|
|
180
|
-
.setName('hello')
|
|
181
|
-
.setDescript('Say hi')
|
|
182
|
-
.setExecute(async ({ interaction }) => interaction.reply('hi'))
|
|
183
|
-
],
|
|
184
|
-
onStart: async ({ client }) => true, // Always return true if the module is loaded
|
|
185
|
-
onLoad: async ({ client }) => {},
|
|
186
|
-
onUnload: async ({ client }) => {}
|
|
187
|
-
};
|
|
188
|
-
```
|
|
24
|
+
If your want to learn more, refer to these websites:
|
|
189
25
|
|
|
190
|
-
[
|
|
26
|
+
- [Reciple Guide](https://reciple.js.org/guide)
|
|
27
|
+
- [Reciple Docs](https://reciple.js.org/docs)
|
|
28
|
+
- [Discord.js Docs](https://discord.js.org/#/)
|
|
29
|
+
- [Discord API Docs](https://discord.com/developers/docs)
|
package/dist/utils/addons.js
CHANGED
|
@@ -8,10 +8,8 @@ export const addonCreators = {
|
|
|
8
8
|
'reciple-registry-cache': addRecipleRegistryCache
|
|
9
9
|
};
|
|
10
10
|
export function createAddonModuleFileContent(pkg, imports, classExport, type, params) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
importStatement = `import ${typeof imports === 'string' ? imports : ('{ ' + imports.join(', ') + ' }')} from '${pkg}';`;
|
|
14
|
-
exportStatement = `export default new ${classExport}(${params ?? ''});`;
|
|
11
|
+
const importStatement = `import ${typeof imports === 'string' ? imports : ('{ ' + imports.join(', ') + ' }')} from '${pkg}';`;
|
|
12
|
+
const exportStatement = `export default new ${classExport}(${params ?? ''});`;
|
|
15
13
|
return importStatement + '\n\n' + exportStatement;
|
|
16
14
|
}
|
|
17
15
|
export async function addRecipleInteractionEvents(dir, type) {
|
package/dist/utils/addons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addons.js","sourceRoot":"","sources":["../../src/utils/addons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,4BAA4B,EAAE,2BAA2B;IACzD,mBAAmB,EAAE,mBAAmB;IACxC,sBAAsB,EAAE,qBAAqB;IAC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C,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IAE9F,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QACzB,MAAM,aAAa,CAAC,KAAmC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACxE,CAAC;AACL,CAAC;AAED,eAAe,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "create-reciple",
|
|
3
3
|
"description": "A Reciple Discord bot project builder",
|
|
4
4
|
"license": "GPL-3.0",
|
|
5
|
-
"version": "9.0.0-dev.
|
|
5
|
+
"version": "9.0.0-dev.12",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"module": "./dist/index.js",
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@clack/prompts": "^0.7.0",
|
|
38
|
-
"@reciple/utils": "^9.0.0-dev.
|
|
38
|
+
"@reciple/utils": "^9.0.0-dev.4",
|
|
39
39
|
"commander": "^12.1.0",
|
|
40
40
|
"fallout-utility": "^2.9.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@reciple/core": "^9.0.0-dev.
|
|
43
|
+
"@reciple/core": "^9.0.0-dev.7",
|
|
44
44
|
"@types/node": "^20.12.12",
|
|
45
45
|
"discord.js": "^14.15.2",
|
|
46
46
|
"nodemon": "^3.1.2",
|
|
47
|
-
"reciple": "^9.0.0-dev.
|
|
47
|
+
"reciple": "^9.0.0-dev.11",
|
|
48
48
|
"rimraf": "^5.0.7",
|
|
49
49
|
"typescript": "^5.4.5"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "eeade43ad057b3fe3234974c325fd8e1967ca867"
|
|
52
52
|
}
|