create-reciple 9.12.0 → 10.0.0

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 (59) hide show
  1. package/dist/index.mjs +10 -0
  2. package/dist/index.mjs.map +1 -0
  3. package/package.json +29 -59
  4. package/LICENSE +0 -674
  5. package/README.md +0 -44
  6. package/assets/README.md +0 -29
  7. package/dist/bin.d.ts +0 -2
  8. package/dist/bin.js +0 -58
  9. package/dist/bin.js.map +0 -1
  10. package/dist/classes/Addon.d.ts +0 -68
  11. package/dist/classes/Addon.js +0 -111
  12. package/dist/classes/Addon.js.map +0 -1
  13. package/dist/classes/Config.d.ts +0 -31
  14. package/dist/classes/Config.js +0 -61
  15. package/dist/classes/Config.js.map +0 -1
  16. package/dist/classes/Setup.d.ts +0 -43
  17. package/dist/classes/Setup.js +0 -149
  18. package/dist/classes/Setup.js.map +0 -1
  19. package/dist/classes/TemplateBuilder.d.ts +0 -94
  20. package/dist/classes/TemplateBuilder.js +0 -244
  21. package/dist/classes/TemplateBuilder.js.map +0 -1
  22. package/dist/index.d.ts +0 -7
  23. package/dist/index.js +0 -8
  24. package/dist/index.js.map +0 -1
  25. package/dist/utils/constants.d.ts +0 -13
  26. package/dist/utils/constants.js +0 -75
  27. package/dist/utils/constants.js.map +0 -1
  28. package/dist/utils/helpers.d.ts +0 -32
  29. package/dist/utils/helpers.js +0 -88
  30. package/dist/utils/helpers.js.map +0 -1
  31. package/dist/utils/types.d.ts +0 -20
  32. package/dist/utils/types.js +0 -2
  33. package/dist/utils/types.js.map +0 -1
  34. package/templates/javascript/dot.gitignore +0 -130
  35. package/templates/javascript/modules/commands/PingCommand.js +0 -68
  36. package/templates/javascript/modules/events/WelcomeEvent.js +0 -54
  37. package/templates/javascript/modules/halts/CommandErrorHalt.js +0 -59
  38. package/templates/javascript/modules/preconditions/ExamplePrecondition.js +0 -27
  39. package/templates/javascript/nodemon.json +0 -16
  40. package/templates/javascript/package.json +0 -18
  41. package/templates/javascript/template.json +0 -4
  42. package/templates/typescript/dot.gitignore +0 -133
  43. package/templates/typescript/nodemon.json +0 -17
  44. package/templates/typescript/package.json +0 -21
  45. package/templates/typescript/src/commands/PingCommand.ts +0 -52
  46. package/templates/typescript/src/events/WelcomeEvent.ts +0 -39
  47. package/templates/typescript/src/halts/CommandErrorHalt.ts +0 -44
  48. package/templates/typescript/src/preconditions/ExamplePrecondition.ts +0 -18
  49. package/templates/typescript/template.json +0 -4
  50. package/templates/typescript/tsconfig.json +0 -19
  51. package/templates/typescript-decorators/dot.gitignore +0 -133
  52. package/templates/typescript-decorators/nodemon.json +0 -17
  53. package/templates/typescript-decorators/package.json +0 -22
  54. package/templates/typescript-decorators/src/commands/PingCommand.ts +0 -45
  55. package/templates/typescript-decorators/src/events/WelcomeEvent.ts +0 -37
  56. package/templates/typescript-decorators/src/halts/CommandErrorHalt.ts +0 -44
  57. package/templates/typescript-decorators/src/preconditions/ExamplePrecondition.ts +0 -18
  58. package/templates/typescript-decorators/template.json +0 -4
  59. package/templates/typescript-decorators/tsconfig.json +0 -19
@@ -1,18 +0,0 @@
1
- import { CommandPreconditionData, ContextMenuCommandExecuteData, MessageCommandExecuteData, SlashCommandExecuteData } from 'reciple';
2
-
3
- export class ExamplePrecondition implements CommandPreconditionData {
4
- id = 'my.reciple.js.exampleprecondition';
5
- disabled = false;
6
-
7
- contextMenuCommandExecute(execute: ContextMenuCommandExecuteData) {
8
- return true;
9
- }
10
-
11
- messageCommandExecute(excute: MessageCommandExecuteData) {
12
- return true;
13
- }
14
-
15
- slashCommandExecute(execute: SlashCommandExecuteData) {
16
- return true;
17
- }
18
- };
@@ -1,4 +0,0 @@
1
- {
2
- "name": "Typescript",
3
- "language": "Typescript"
4
- }
@@ -1,19 +0,0 @@
1
- {
2
- "include": ["./src/**/*"],
3
- "compilerOptions": {
4
- "rootDir": "./src",
5
- "outDir": "./modules",
6
- "target": "ESNext",
7
- "module": "NodeNext",
8
- "moduleResolution": "NodeNext",
9
- "esModuleInterop": true,
10
- "skipLibCheck": true,
11
- "sourceMap": true,
12
- "strict": true,
13
- "experimentalDecorators": true,
14
- "emitDecoratorMetadata": true,
15
- "paths": {
16
- "@/*": ["./src/*"]
17
- }
18
- }
19
- }
@@ -1,133 +0,0 @@
1
- # Logs
2
- logs
3
- *.log
4
- npm-debug.log*
5
- yarn-debug.log*
6
- yarn-error.log*
7
- lerna-debug.log*
8
- .pnpm-debug.log*
9
-
10
- # Diagnostic reports (https://nodejs.org/api/report.html)
11
- report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12
-
13
- # Runtime data
14
- pids
15
- *.pid
16
- *.seed
17
- *.pid.lock
18
-
19
- # Directory for instrumented libs generated by jscoverage/JSCover
20
- lib-cov
21
-
22
- # Docs files
23
- docs.json
24
-
25
- # Coverage directory used by tools like istanbul
26
- coverage
27
- *.lcov
28
-
29
- # nyc test coverage
30
- .nyc_output
31
-
32
- # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
33
- .grunt
34
-
35
- # Bower dependency directory (https://bower.io/)
36
- bower_components
37
-
38
- # node-waf configuration
39
- .lock-wscript
40
-
41
- # Compiled binary addons (https://nodejs.org/api/addons.html)
42
- build/Release
43
-
44
- # Dependency directories
45
- node_modules/
46
- jspm_packages/
47
-
48
- # Snowpack dependency directory (https://snowpack.dev/)
49
- web_modules/
50
-
51
- # TypeScript cache
52
- *.tsbuildinfo
53
-
54
- # Optional npm cache directory
55
- .npm
56
-
57
- # Optional eslint cache
58
- .eslintcache
59
-
60
- # Optional stylelint cache
61
- .stylelintcache
62
-
63
- # Microbundle cache
64
- .rpt2_cache/
65
- .rts2_cache_cjs/
66
- .rts2_cache_es/
67
- .rts2_cache_umd/
68
-
69
- # Optional REPL history
70
- .node_repl_history
71
-
72
- # Output of 'npm pack'
73
- *.tgz
74
-
75
- # Yarn Integrity file
76
- .yarn-integrity
77
-
78
- # dotenv environment variable files
79
- .env
80
- .env.development.local
81
- .env.test.local
82
- .env.production.local
83
- .env.local
84
-
85
- # parcel-bundler cache (https://parceljs.org/)
86
- .cache
87
- .parcel-cache
88
-
89
- # Next.js build output
90
- .next
91
- out
92
-
93
- # Nuxt.js build / generate output
94
- .nuxt
95
- dist
96
-
97
- # Gatsby files
98
- .cache/
99
- # Comment in the public line in if your project uses Gatsby and not Next.js
100
- # https://nextjs.org/blog/next-9-1#public-directory-support
101
- # public
102
-
103
- # vuepress build output
104
- .vuepress/dist
105
-
106
- # vuepress v2.x temp and cache directory
107
- .temp
108
- .cache
109
-
110
- # Serverless directories
111
- .serverless/
112
-
113
- # FuseBox cache
114
- .fusebox/
115
-
116
- # DynamoDB Local files
117
- .dynamodb/
118
-
119
- # TernJS port file
120
- .tern-port
121
-
122
- # Stores VSCode versions used for testing VSCode extensions
123
- .vscode-test
124
-
125
- # yarn v2
126
- .yarn/cache
127
- .yarn/unplugged
128
- .yarn/build-state.yml
129
- .yarn/install-state.gz
130
- .pnp.*
131
-
132
- # Output files
133
- modules
@@ -1,17 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/nodemon.json",
3
- "restartable": "r",
4
- "ext": "ts,mts,mjs,json",
5
- "signal": "SIGHUP",
6
- "ignore": [
7
- ".git",
8
- "node_modules/**",
9
- "modules"
10
- ],
11
- "watch": [
12
- "src",
13
- "reciple.mjs",
14
- ".env"
15
- ],
16
- "exec": "rimraf ./modules && tsc && reciple start"
17
- }
@@ -1,22 +0,0 @@
1
- {
2
- "name": "reciple-app",
3
- "type": "module",
4
- "private": true,
5
- "scripts": {
6
- "build": "rimraf ./modules && tsc",
7
- "start": "reciple start -c reciple.mjs",
8
- "build:start": "SCRIPT_RUN build && reciple start -c reciple.mjs",
9
- "dev": "nodemon --config nodemon.json"
10
- },
11
- "dependencies": {
12
- "@reciple/core": "RECIPLE_CORE",
13
- "@reciple/decorators": "RECIPLE_DECORATORS",
14
- "discord.js": "DISCORDJS",
15
- "reciple": "RECIPLE"
16
- },
17
- "devDependencies": {
18
- "@types/node": "TYPES_NODE",
19
- "typescript": "TYPESCRIPT",
20
- "rimraf": "RIMRAF"
21
- }
22
- }
@@ -1,45 +0,0 @@
1
- import { setContextMenuCommand, setMessageCommand, setRecipleModule, setRecipleModuleLoad, setRecipleModuleStart, setRecipleModuleUnload, setSlashCommand } from '@reciple/decorators';
2
- import { AnyCommandExecuteData, CommandType, RecipleModuleData } from "reciple";
3
-
4
- @setRecipleModule()
5
- export class PingCommand implements RecipleModuleData {
6
- /**
7
- * Executed when module is started (Bot is not logged in).
8
- */
9
- @setRecipleModuleStart()
10
- async onStart(): Promise<boolean> {
11
- return true;
12
- }
13
-
14
- /**
15
- * Executes when the module is loaded (Bot is logged in).
16
- */
17
- @setRecipleModuleLoad()
18
- async onLoad(): Promise<void> {}
19
-
20
- /**
21
- * Executes when the module is unloaded (Bot is pre log out).
22
- */
23
- @setRecipleModuleUnload()
24
- async onUnload(): Promise<void> {}
25
-
26
- /**
27
- * Sets the commands
28
- */
29
- @setContextMenuCommand({ name: 'ping', type: 'Message' })
30
- @setMessageCommand({ name: 'ping', description: 'Replies with pong!' })
31
- @setSlashCommand({ name: 'ping', description: 'Replies with pong!' })
32
- async handleCommandExecute(data: AnyCommandExecuteData): Promise<void> {
33
- switch (data.type) {
34
- case CommandType.ContextMenuCommand:
35
- case CommandType.SlashCommand:
36
- await data.interaction.reply('Pong!');
37
- return;
38
- case CommandType.MessageCommand:
39
- await data.message.reply('Pong!');
40
- return;
41
- }
42
- }
43
- }
44
-
45
- export default new PingCommand();
@@ -1,37 +0,0 @@
1
- import { setClientEvent, setRecipleModule, setRecipleModuleLoad, setRecipleModuleStart, setRecipleModuleUnload } from '@reciple/decorators';
2
- import { GuildMember } from "discord.js";
3
- import { RecipleModuleData } from 'reciple';
4
-
5
- @setRecipleModule()
6
- export class WelcomeEvent implements RecipleModuleData {
7
- /**
8
- * Executed when module is started (Bot is not logged in).
9
- */
10
- @setRecipleModuleStart()
11
- async onStart(): Promise<boolean> {
12
- return true;
13
- }
14
-
15
- /**
16
- * Executes when the module is loaded (Bot is logged in).
17
- */
18
- @setRecipleModuleLoad()
19
- async onLoad(): Promise<void> {}
20
-
21
- /**
22
- * Executes when the module is unloaded (Bot is pre log out).
23
- */
24
- @setRecipleModuleUnload()
25
- async onUnload(): Promise<void> {}
26
-
27
- /**
28
- * Called when a user joins the server.
29
- */
30
- @setClientEvent('guildMemberAdd')
31
- async handleWelcomeEvent(member: GuildMember): Promise<void> {
32
- await member.send(`Welcome to **${member.guild.name}** server!`)
33
- .catch(() => null);
34
- }
35
- }
36
-
37
- export default new WelcomeEvent();
@@ -1,44 +0,0 @@
1
- import { AnyCommandHaltTriggerData, CommandHaltData, CommandHaltReason, CommandType, ContextMenuCommandHaltTriggerData, MessageCommandHaltTriggerData, SlashCommandHaltTriggerData } from 'reciple';
2
-
3
- export class CommandErrorHalt implements CommandHaltData {
4
- id = 'my.reciple.js.commanderrorhalt';
5
- disabled = false;
6
-
7
- contextMenuCommandHalt(data: ContextMenuCommandHaltTriggerData) {
8
- return this.halt(data);
9
- }
10
-
11
- messageCommandHalt(data: MessageCommandHaltTriggerData) {
12
- return this.halt(data);
13
- }
14
-
15
- slashCommandHalt(data: SlashCommandHaltTriggerData) {
16
- return this.halt(data);
17
- }
18
-
19
- async halt(data: AnyCommandHaltTriggerData) {
20
- if (data.reason !== CommandHaltReason.Error) return;
21
-
22
- const content = `An error occured while executing this command`;
23
-
24
- switch (data.commandType) {
25
- case CommandType.ContextMenuCommand:
26
- case CommandType.SlashCommand:
27
- const interaction = data.executeData.interaction;
28
-
29
- if (interaction.replied || interaction.deferred) {
30
- await interaction.editReply(content);
31
- } else {
32
- await interaction.reply(content);
33
- }
34
- break;
35
- case CommandType.MessageCommand:
36
- await data.executeData.message.reply(content);
37
- break;
38
- }
39
-
40
- reciple.logger?.error(data.error);
41
-
42
- return true;
43
- }
44
- }
@@ -1,18 +0,0 @@
1
- import { CommandPreconditionData, ContextMenuCommandExecuteData, MessageCommandExecuteData, SlashCommandExecuteData } from 'reciple';
2
-
3
- export class ExamplePrecondition implements CommandPreconditionData {
4
- id = 'my.reciple.js.exampleprecondition';
5
- disabled = false;
6
-
7
- contextMenuCommandExecute(execute: ContextMenuCommandExecuteData) {
8
- return true;
9
- }
10
-
11
- messageCommandExecute(excute: MessageCommandExecuteData) {
12
- return true;
13
- }
14
-
15
- slashCommandExecute(execute: SlashCommandExecuteData) {
16
- return true;
17
- }
18
- }
@@ -1,4 +0,0 @@
1
- {
2
- "name": "Typescript (With Decorators)",
3
- "language": "Typescript"
4
- }
@@ -1,19 +0,0 @@
1
- {
2
- "include": ["./src/**/*"],
3
- "compilerOptions": {
4
- "rootDir": "./src",
5
- "outDir": "./modules",
6
- "target": "ESNext",
7
- "module": "NodeNext",
8
- "moduleResolution": "NodeNext",
9
- "esModuleInterop": true,
10
- "skipLibCheck": true,
11
- "sourceMap": true,
12
- "strict": true,
13
- "experimentalDecorators": true,
14
- "emitDecoratorMetadata": true,
15
- "paths": {
16
- "@/*": ["./src/*"]
17
- }
18
- }
19
- }