reciple 6.0.0-dev.3 → 6.0.0-dev.30

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 (97) hide show
  1. package/LICENSE +674 -674
  2. package/README.md +183 -183
  3. package/dist/lib/bin.mjs +70 -0
  4. package/dist/lib/bin.mjs.map +1 -0
  5. package/dist/lib/esm.mjs +2 -0
  6. package/dist/lib/esm.mjs.map +1 -0
  7. package/dist/{cjs → lib}/index.js +17 -17
  8. package/dist/lib/index.js.map +1 -0
  9. package/dist/{cjs → lib}/reciple/classes/RecipleClient.js +42 -33
  10. package/dist/lib/reciple/classes/RecipleClient.js.map +1 -0
  11. package/dist/{cjs → lib}/reciple/classes/RecipleConfig.js +11 -10
  12. package/dist/lib/reciple/classes/RecipleConfig.js.map +1 -0
  13. package/dist/lib/reciple/classes/RecipleModule.js +137 -0
  14. package/dist/lib/reciple/classes/RecipleModule.js.map +1 -0
  15. package/dist/lib/reciple/classes/builders/MessageCommandBuilder.js +310 -0
  16. package/dist/lib/reciple/classes/builders/MessageCommandBuilder.js.map +1 -0
  17. package/dist/{cjs → lib}/reciple/classes/builders/MessageCommandOptionBuilder.js +55 -13
  18. package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js.map +1 -0
  19. package/dist/{cjs → lib}/reciple/classes/builders/SlashCommandBuilder.js +43 -15
  20. package/dist/lib/reciple/classes/builders/SlashCommandBuilder.js.map +1 -0
  21. package/dist/{cjs → lib}/reciple/classes/managers/ApplicationCommandManager.js +69 -27
  22. package/dist/lib/reciple/classes/managers/ApplicationCommandManager.js.map +1 -0
  23. package/dist/{cjs → lib}/reciple/classes/managers/CommandCooldownManager.js +1 -1
  24. package/dist/lib/reciple/classes/managers/CommandCooldownManager.js.map +1 -0
  25. package/dist/{cjs/reciple/classes/managers/ClientCommandManager.js → lib/reciple/classes/managers/CommandManager.js} +21 -16
  26. package/dist/lib/reciple/classes/managers/CommandManager.js.map +1 -0
  27. package/dist/{cjs → lib}/reciple/classes/managers/MessageCommandOptionManager.js +1 -0
  28. package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js.map +1 -0
  29. package/dist/lib/reciple/classes/managers/ModuleManager.js +181 -0
  30. package/dist/lib/reciple/classes/managers/ModuleManager.js.map +1 -0
  31. package/dist/{cjs → lib}/reciple/flags.js +4 -3
  32. package/dist/lib/reciple/flags.js.map +1 -0
  33. package/dist/{cjs → lib}/reciple/permissions.js +1 -0
  34. package/dist/lib/reciple/permissions.js.map +1 -0
  35. package/dist/lib/reciple/types/builders.js +12 -0
  36. package/dist/lib/reciple/types/builders.js.map +1 -0
  37. package/dist/{cjs → lib}/reciple/types/commands.js +7 -6
  38. package/dist/lib/reciple/types/commands.js.map +1 -0
  39. package/dist/{cjs → lib}/reciple/types/paramOptions.js +1 -0
  40. package/dist/lib/reciple/types/paramOptions.js.map +1 -0
  41. package/dist/{cjs/reciple/logger.js → lib/reciple/util.js} +40 -5
  42. package/dist/lib/reciple/util.js.map +1 -0
  43. package/dist/{cjs → lib}/reciple/version.js +1 -1
  44. package/dist/lib/reciple/version.js.map +1 -0
  45. package/dist/types/{bin.d.ts → bin.d.mts} +1 -0
  46. package/dist/types/bin.d.mts.map +1 -0
  47. package/dist/types/esm.d.mts +2 -0
  48. package/dist/types/esm.d.mts.map +1 -0
  49. package/dist/types/index.d.ts +17 -17
  50. package/dist/types/index.d.ts.map +1 -0
  51. package/dist/types/reciple/classes/RecipleClient.d.ts +22 -8
  52. package/dist/types/reciple/classes/RecipleClient.d.ts.map +1 -0
  53. package/dist/types/reciple/classes/RecipleConfig.d.ts +4 -2
  54. package/dist/types/reciple/classes/RecipleConfig.d.ts.map +1 -0
  55. package/dist/types/reciple/classes/RecipleModule.d.ts +88 -0
  56. package/dist/types/reciple/classes/RecipleModule.d.ts.map +1 -0
  57. package/dist/types/reciple/classes/builders/MessageCommandBuilder.d.ts +67 -27
  58. package/dist/types/reciple/classes/builders/MessageCommandBuilder.d.ts.map +1 -0
  59. package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts +18 -7
  60. package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts.map +1 -0
  61. package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts +23 -12
  62. package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts.map +1 -0
  63. package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts +46 -12
  64. package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts.map +1 -0
  65. package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts +3 -2
  66. package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts.map +1 -0
  67. package/dist/types/reciple/classes/managers/CommandManager.d.ts +35 -0
  68. package/dist/types/reciple/classes/managers/CommandManager.d.ts.map +1 -0
  69. package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts +2 -1
  70. package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts.map +1 -0
  71. package/dist/types/reciple/classes/managers/ModuleManager.d.ts +50 -0
  72. package/dist/types/reciple/classes/managers/ModuleManager.d.ts.map +1 -0
  73. package/dist/types/reciple/flags.d.ts +2 -1
  74. package/dist/types/reciple/flags.d.ts.map +1 -0
  75. package/dist/types/reciple/permissions.d.ts +3 -6
  76. package/dist/types/reciple/permissions.d.ts.map +1 -0
  77. package/dist/types/reciple/types/builders.d.ts +29 -20
  78. package/dist/types/reciple/types/builders.d.ts.map +1 -0
  79. package/dist/types/reciple/types/commands.d.ts +19 -18
  80. package/dist/types/reciple/types/commands.d.ts.map +1 -0
  81. package/dist/types/reciple/types/paramOptions.d.ts +80 -18
  82. package/dist/types/reciple/types/paramOptions.d.ts.map +1 -0
  83. package/dist/types/reciple/util.d.ts +17 -2
  84. package/dist/types/reciple/util.d.ts.map +1 -0
  85. package/dist/types/reciple/version.d.ts +1 -0
  86. package/dist/types/reciple/version.d.ts.map +1 -0
  87. package/package.json +46 -36
  88. package/resource/reciple.yml +120 -117
  89. package/dist/cjs/bin.js +0 -50
  90. package/dist/cjs/reciple/classes/builders/MessageCommandBuilder.js +0 -242
  91. package/dist/cjs/reciple/classes/managers/ClientModuleManager.js +0 -193
  92. package/dist/cjs/reciple/types/builders.js +0 -11
  93. package/dist/cjs/reciple/util.js +0 -32
  94. package/dist/types/reciple/classes/managers/ClientCommandManager.d.ts +0 -37
  95. package/dist/types/reciple/classes/managers/ClientModuleManager.d.ts +0 -79
  96. package/dist/types/reciple/logger.d.ts +0 -8
  97. package/docs/README.md +0 -1
@@ -1,21 +1,7 @@
1
- import { RecipleModule, RecipleScript } from '../classes/managers/ClientModuleManager';
2
1
  import { ConfigCommandPermissions } from '../classes/RecipleConfig';
3
- import { PermissionsBitField } from 'discord.js';
2
+ import { Awaitable, PermissionsBitField } from 'discord.js';
3
+ import { RecipleModule } from '../classes/RecipleModule';
4
4
  import { AnyCommandBuilder } from './builders';
5
- export interface RecipleClientAddModuleOptions {
6
- /**
7
- * The module script
8
- */
9
- script: RecipleScript;
10
- /**
11
- * Register application commands if possible
12
- */
13
- registerApplicationCommands?: boolean;
14
- /**
15
- * Module optional info
16
- */
17
- moduleInfo?: RecipleModule['info'];
18
- }
19
5
  export interface UserHasCommandPermissionsOptions {
20
6
  /**
21
7
  * Command builder
@@ -33,8 +19,84 @@ export interface UserHasCommandPermissionsOptions {
33
19
  commands: ConfigCommandPermissions[];
34
20
  };
35
21
  }
36
- export interface ModuleManagerResolveFilesOptions {
22
+ export interface ModuleManagerResolveModuleFilesOptions {
23
+ /**
24
+ * valid reciple module (ESM or CJS) Javascript file paths
25
+ */
37
26
  files: string[];
27
+ /**
28
+ * Allow loading unsupported module versions
29
+ * @default false
30
+ */
38
31
  disabeVersionCheck?: boolean;
39
- dontSkipError?: boolean;
32
+ /**
33
+ * Ignore errors
34
+ * @dafault true
35
+ */
36
+ ignoreErrors?: boolean;
37
+ }
38
+ export interface ModuleManagerGetModulePathsOptions {
39
+ /**
40
+ * Get javascript module file paths from folders
41
+ */
42
+ folders?: string[];
43
+ /**
44
+ * Add ignored files (wildcard)
45
+ * @example _*.js // Ignores _module.js and _hi.js
46
+ */
47
+ ignoredFiles?: string[];
48
+ /**
49
+ * Filter found javascript files
50
+ * @param file Loaded javascript file
51
+ * @returns `true` if the path is acceptable
52
+ */
53
+ filter?: (file: string) => Awaitable<boolean>;
54
+ }
55
+ export interface ModuleManagerStartModulesOptions {
56
+ /**
57
+ * Modules to start
58
+ */
59
+ modules: RecipleModule[];
60
+ /**
61
+ * Add modules to Client modules collection
62
+ * @default true
63
+ */
64
+ addToModulesCollection?: boolean;
65
+ /**
66
+ * Ignore errors
67
+ * @default true
68
+ */
69
+ ignoreErrors?: boolean;
70
+ }
71
+ export interface ModuleManagerLoadModulesOptions {
72
+ /**
73
+ * Modules to execute `load` method
74
+ */
75
+ modules?: RecipleModule[];
76
+ /**
77
+ * Add commands to client
78
+ * @default true
79
+ */
80
+ resolveCommands?: boolean;
81
+ /**
82
+ * Ignore errors
83
+ * @default true
84
+ */
85
+ ignoreErrors?: boolean;
86
+ }
87
+ export interface ModuleManagerUnloadModulesOptions {
88
+ /**
89
+ * Modules to execute `unload` method
90
+ */
91
+ modules?: RecipleModule[];
92
+ /**
93
+ * Reason for unloading modules
94
+ */
95
+ reason?: string;
96
+ /**
97
+ * Ignore errors
98
+ * @default true
99
+ */
100
+ ignoreErrors?: boolean;
40
101
  }
102
+ //# sourceMappingURL=paramOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paramOptions.d.ts","sourceRoot":"","sources":["../../../../src/reciple/types/paramOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,gCAAgC;IAC7C;;OAEG;IACH,OAAO,EAAE,iBAAiB,CAAC;IAC3B;;OAEG;IACH,iBAAiB,CAAC,EAAE,mBAAmB,CAAC;IACxC;;OAEG;IACH,kBAAkB,CAAC,EAAE;QACjB,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,wBAAwB,EAAE,CAAC;KACxC,CAAC;CACL;AAED,MAAM,WAAW,sCAAsC;IACnD;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,kCAAkC;IAC/C;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC,OAAO,CAAC,CAAC;CACjD;AAED,MAAM,WAAW,gCAAgC;IAC7C;;OAEG;IACH,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,+BAA+B;IAC5C;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,iCAAiC;IAC9C;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B"}
@@ -1,12 +1,27 @@
1
+ /// <reference types="node" />
2
+ import { Logger } from 'fallout-utility';
1
3
  import { AnyCommandBuilder } from './types/builders';
4
+ import _path from 'path';
2
5
  /**
3
6
  * Check if an object is a class
4
7
  * @param object Object to identify
5
8
  */
6
- export declare function isClass<T = any>(object: any): object is T;
9
+ export declare function isClass<T>(object: any): object is T;
7
10
  /**
8
11
  * Emit process warning about deprecated method/function
9
12
  * @param content Warning content
10
13
  */
11
14
  export declare function deprecationWarning(content: string | Error): void;
12
- export declare function validateCommandBuilder(command: AnyCommandBuilder): boolean;
15
+ export declare function validateCommandBuilder(command: AnyCommandBuilder): command is AnyCommandBuilder;
16
+ /**
17
+ * Create new logger
18
+ * @param stringifyJSON stringify json objects in console
19
+ * @param debugmode display debug messages
20
+ * @param colorizeMessage add logger colours to messages
21
+ */
22
+ export declare function createLogger(stringifyJSON: boolean, debugmode?: boolean, colorizeMessage?: boolean): Logger;
23
+ /**
24
+ * Path module that depending on os
25
+ */
26
+ export declare const path: _path.PlatformPath;
27
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/reciple/util.ts"],"names":[],"mappings":";AAAA,OAAO,EAAsB,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAe,MAAM,kBAAkB,CAAC;AAGlE,OAAO,KAAK,MAAM,MAAM,CAAC;AAEzB;;;GAGG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,CAAC,CAMnD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI,CAEhE;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,IAAI,iBAAiB,CAK/F;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,aAAa,EAAE,OAAO,EAAE,SAAS,GAAE,OAAe,EAAE,eAAe,GAAE,OAAc,GAAG,MAAM,CAoBxH;AAED;;GAEG;AACH,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,YAA8E,CAAC"}
@@ -23,3 +23,4 @@ export declare function parseVersion(ver: string): semver.SemVer | null;
23
23
  * @param supportedVersion Version to match given version range
24
24
  */
25
25
  export declare function isSupportedVersion(versionRange: string, supportedVersion?: string): boolean;
26
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/reciple/version.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B;;GAEG;AACH,eAAO,MAAM,OAAO,QAA+D,CAAC;AAEpF;;GAEG;AACH,eAAO,MAAM,UAAU,KAA2C,CAAC;AAEnE;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,WAEzC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,wBAIvC;AACD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,WAOjF"}
package/package.json CHANGED
@@ -1,18 +1,29 @@
1
1
  {
2
2
  "name": "reciple",
3
- "version": "6.0.0-dev.3",
4
- "bin": "./dist/cjs/bin.js",
3
+ "type": "commonjs",
5
4
  "license": "GPL-3.0",
6
- "main": "./dist/cjs/index.js",
7
- "types": "./dist/types/index.d.ts",
8
- "module": "./dist/mjs/index.js",
5
+ "engineStrict": true,
6
+ "version": "6.0.0-dev.30",
9
7
  "author": "FalloutStudios",
10
- "description": "Handler for Discord.js",
8
+ "main": "./dist/lib/index.js",
9
+ "module": "./dist/lib/esm.mjs",
10
+ "types": "./dist/types/index.d.ts",
11
+ "description": "A simple Discord.js handler that just works",
11
12
  "homepage": "https://reciple.js.org",
13
+ "bin": {
14
+ "reciple": "./dist/lib/bin.mjs"
15
+ },
12
16
  "exports": {
13
- "require": "./dist/cjs/index.js",
14
- "import": "./dist/mjs/index.js",
15
- "types": "./dist/types/index.d.ts"
17
+ ".": {
18
+ "import": {
19
+ "types": "./dist/types/index.d.ts",
20
+ "default": "./dist/lib/esm.mjs"
21
+ },
22
+ "require": {
23
+ "types": "./dist/types/index.d.ts",
24
+ "default": "./dist/lib/index.js"
25
+ }
26
+ }
16
27
  },
17
28
  "keywords": [
18
29
  "Discord",
@@ -25,53 +36,52 @@
25
36
  "bugs": {
26
37
  "url": "https://github.com/FalloutStudios/reciple/issues"
27
38
  },
28
- "scripts": {
29
- "format": "yarn prettier --write src",
30
- "clean": "yarn exec rimraf dist",
31
- "build": "yarn clean && yarn format && yarn exec tsc",
32
- "build:publish": "yarn build && yarn docs && yarn npm publish",
33
- "build:publish-dev": "yarn build && yarn npm publish --tag dev",
34
- "test": "yarn build && yarn workspace test start",
35
- "docs": "yarn exec docgen --typescript true -c ./docs/index.json -o ./docs/docs.json -i src/index.ts",
36
- "watch": "yarn exec tsc --watch --noEmit"
37
- },
38
- "repository": {
39
- "type": "git",
40
- "url": "git+https://github.com/FalloutStudios/reciple.git"
41
- },
42
- "engineStrict": true,
43
39
  "engines": {
44
40
  "node": ">=16.9.0"
45
41
  },
42
+ "workspaces": [
43
+ "test"
44
+ ],
46
45
  "files": [
47
46
  "dist",
48
47
  "resource",
49
48
  "LICENSE",
50
49
  "README.md"
51
50
  ],
51
+ "scripts": {
52
+ "format": "npx prettier --write src",
53
+ "clean": "npx rimraf dist",
54
+ "build": "npm run clean && npx tsc",
55
+ "build:publish": "npm run format && npm run build && npm run docs && npm publish",
56
+ "build:publish-dev": "npm run format && npm run build && npm publish --tag dev",
57
+ "test": "npm run build && npm install && npm run start -w test",
58
+ "docs": "npx docgen --typescript true -c ./docs/index.json -o ./docs/docs.json -i src/index.ts",
59
+ "watch": "npx tsc --watch --noEmit"
60
+ },
61
+ "repository": {
62
+ "type": "git",
63
+ "url": "git+https://github.com/FalloutStudios/reciple.git"
64
+ },
52
65
  "dependencies": {
53
66
  "chalk": "4.1.2",
54
67
  "commander": "^9.4.1",
55
68
  "dotenv": "^16.0.3",
56
- "fallout-utility": "^1.5.4",
69
+ "fallout-utility": "^1.5.17",
70
+ "micromatch": "^4.0.5",
57
71
  "semver": "^7.3.7",
58
- "wildcard-match": "^5.1.2",
59
72
  "yaml": "^2.1.1"
60
73
  },
61
74
  "devDependencies": {
62
75
  "@discordjs/docgen": "^0.12.1",
63
- "@types/node": "^18.11.0",
64
- "@types/semver": "^7.3.12",
76
+ "@types/micromatch": "^4.0.2",
77
+ "@types/node": "^18.11.9",
78
+ "@types/semver": "^7.3.13",
65
79
  "discord.js": "^14.6.0",
66
- "prettier": "2.7.1",
80
+ "prettier": "^2.7.1",
67
81
  "rimraf": "^3.0.2",
68
- "typescript": "^4.8.4"
82
+ "typescript": "^4.9.3"
69
83
  },
70
84
  "peerDependencies": {
71
85
  "discord.js": "^14.5.0"
72
- },
73
- "workspaces": [
74
- "test"
75
- ],
76
- "packageManager": "yarn@3.2.2"
77
- }
86
+ }
87
+ }
@@ -1,117 +1,120 @@
1
- # Your bot token here
2
- # To use env variable as a token just do it like this env:TOKEN_ENV
3
- token: TOKEN
4
-
5
- # Commands options
6
- commands:
7
- # message command options
8
- messageCommand:
9
- # enable message commands
10
- enabled: true
11
- # command prefix
12
- prefix: '!'
13
- # reply when an error occured
14
- replyOnError: false
15
- # enable the use of command cooldowns
16
- enableCooldown: true
17
- # allow executing commands via aliases
18
- allowCommandAlias: true
19
- # command argument separator
20
- commandArgumentSeparator: ' '
21
- # overwrite command permissions
22
- permissions:
23
- # enable overwriten command permissions
24
- enabled: false
25
- commands:
26
- - command: example-command
27
- permissions:
28
- - Administrator
29
-
30
- # Interaction command options
31
- slashCommand:
32
- # enable interaction commands
33
- enabled: true
34
- # reply when an error occured
35
- replyOnError: false
36
- # enable the use of command cooldowns
37
- enableCooldown: true
38
- # register interaction commands on bot ready
39
- registerCommands: true
40
- # set required permissions for interaction commands
41
- setRequiredPermissions: true
42
- # accept replied or deffered command interaction
43
- acceptRepliedInteractions: false
44
- # register commands to specific guild(s) empty to make it global
45
- guilds: []
46
- # overwrite command permissions
47
- permissions:
48
- # enable overwriten command permissions
49
- enabled: false
50
- commands:
51
- - command: example-command
52
- permissions:
53
- - Administrator
54
-
55
-
56
- # Logger options
57
- fileLogging:
58
- # enable console output to file
59
- enabled: true
60
- # enable debug mode
61
- debugmode: false
62
- # enable if reciple will use the logger
63
- clientLogs: true
64
- # stringify logged JSONs
65
- stringifyLoggedJSON: false
66
- # log file path
67
- logFilePath: logs/latest.log
68
-
69
- # Client options
70
- # Learn more about client options at https://discord.js.org/#/docs/discord.js/main/typedef/ClientOptions
71
- client:
72
- intents:
73
- - Guilds
74
- - GuildMembers
75
- - GuildMessages
76
- - MessageContent
77
-
78
- # Bot messages
79
- messages:
80
- missingArguments: Not enough arguments.
81
- invalidArguments: Invalid argument(s) given.
82
- insufficientBotPerms:
83
- content: Insufficient bot permissions.
84
- ephemeral: true
85
- noPermissions:
86
- content: You do not have permission to use this command.
87
- ephemeral: true
88
- cooldown:
89
- content: You cannot execute this command right now due to the cooldown.
90
- ephemeral: true
91
- error:
92
- content: An error occurred.
93
- ephemeral: true
94
-
95
- # Ignored Files
96
- ignoredFiles: []
97
-
98
-
99
- ####################################################
100
- # #
101
- # ##### ##### # # ### ##### #### #
102
- # # # # # # # # # # # # #
103
- # # # ##### # # # # ### ### #### #
104
- # # # # # # # # # # # # #
105
- # ### # # # # ### ##### # # #
106
- # #
107
- ####################################################
108
- ## Modifying the values below could break reciple ##
109
-
110
- # Modules folder
111
- modulesFolder: 'modules'
112
-
113
- # Load modules regardless of its supported versions
114
- disableVersionCheck: false
115
-
116
- # Current version
117
- version: ^VERSION
1
+ # Your bot token here
2
+ # To use env variable as a token just do it like this env:TOKEN_ENV
3
+ token: TOKEN
4
+
5
+ # Commands options
6
+ commands:
7
+ # Interaction command options
8
+ slashCommand:
9
+ # enable interaction commands
10
+ enabled: true
11
+ # reply when an error occured
12
+ replyOnError: false
13
+ # enable the use of command cooldowns
14
+ enableCooldown: true
15
+ # register interaction commands on bot ready
16
+ registerCommands: true
17
+ # allow register empty list of application commands
18
+ allowRegisterEmptyCommandList: true
19
+ # set required permissions for interaction commands
20
+ setRequiredPermissions: true
21
+ # accept replied or deffered command interaction
22
+ acceptRepliedInteractions: false
23
+ # register commands to specific guild(s) empty to make it global
24
+ guilds: []
25
+ # overwrite command permissions
26
+ permissions:
27
+ # enable overwriten command permissions
28
+ enabled: false
29
+ commands:
30
+ - command: example-command
31
+ permissions:
32
+ - Administrator
33
+
34
+ # message command options
35
+ messageCommand:
36
+ # enable message commands
37
+ enabled: true
38
+ # command prefix
39
+ prefix: '!'
40
+ # reply when an error occured
41
+ replyOnError: false
42
+ # enable the use of command cooldowns
43
+ enableCooldown: true
44
+ # allow executing commands via aliases
45
+ allowCommandAlias: true
46
+ # command argument separator
47
+ commandArgumentSeparator: ' '
48
+ # overwrite command permissions
49
+ permissions:
50
+ # enable overwriten command permissions
51
+ enabled: false
52
+ commands:
53
+ - command: example-command
54
+ permissions:
55
+ - Administrator
56
+
57
+ # Logger options
58
+ fileLogging:
59
+ # enable console output to file
60
+ enabled: true
61
+ # enable debug mode
62
+ debugmode: false
63
+ # enable if reciple will use the logger
64
+ clientLogs: true
65
+ # stringify logged JSONs
66
+ stringifyLoggedJSON: false
67
+ # log file path
68
+ logFilePath: logs/latest.log
69
+
70
+ # Client options
71
+ # Learn more about client options at https://discord.js.org/#/docs/discord.js/main/typedef/ClientOptions
72
+ client:
73
+ intents:
74
+ - Guilds
75
+ - GuildMembers
76
+ - GuildMessages
77
+ - MessageContent
78
+
79
+ # Bot messages
80
+ messages:
81
+ missingArguments: Not enough arguments.
82
+ invalidArguments: Invalid argument(s) given.
83
+ insufficientBotPerms:
84
+ content: Insufficient bot permissions.
85
+ ephemeral: true
86
+ noPermissions:
87
+ content: You do not have permission to use this command.
88
+ ephemeral: true
89
+ cooldown:
90
+ content: You cannot execute this command right now due to the cooldown.
91
+ ephemeral: true
92
+ error:
93
+ content: An error occurred.
94
+ ephemeral: true
95
+
96
+ # Ignored Files
97
+ ignoredFiles:
98
+ - '_*'
99
+ - '.*'
100
+
101
+
102
+ ####################################################
103
+ # #
104
+ # ##### ##### # # ### ##### #### #
105
+ # # # # # # # # # # # # #
106
+ # # # ##### # # # # ### ### #### #
107
+ # # # # # # # # # # # # #
108
+ # ### # # # # ### ##### # # #
109
+ # #
110
+ ####################################################
111
+ ## Modifying the values below could break reciple ##
112
+
113
+ # Modules folder
114
+ modulesFolder: 'modules'
115
+
116
+ # Load modules regardless of its supported versions
117
+ disableVersionCheck: false
118
+
119
+ # Current version
120
+ version: ^VERSION
package/dist/cjs/bin.js DELETED
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const RecipleClient_1 = require("./reciple/classes/RecipleClient");
8
- const RecipleConfig_1 = require("./reciple/classes/RecipleConfig");
9
- const version_1 = require("./reciple/version");
10
- const fs_1 = require("fs");
11
- const flags_1 = require("./reciple/flags");
12
- const fallout_utility_1 = require("fallout-utility");
13
- const chalk_1 = __importDefault(require("chalk"));
14
- require("dotenv/config");
15
- const path_1 = __importDefault(require("path"));
16
- const allowedFiles = ['node_modules', 'reciple.yml', 'package.json'];
17
- const configPath = path_1.default.join(flags_1.cwd, './reciple.yml');
18
- if ((0, fs_1.readdirSync)(flags_1.cwd).filter(f => !f.startsWith('.') && allowedFiles.indexOf(f)).length > 0 && !(0, fs_1.existsSync)(flags_1.flags.config ?? configPath)) {
19
- const ask = (flags_1.flags.yes ? 'y' : null) ?? (0, fallout_utility_1.input)('This directory does not contain reciple.yml. Would you like to init axis here? [y/n] ') ?? '';
20
- if (ask.toString().toLowerCase() !== 'y')
21
- process.exit(0);
22
- }
23
- let configParser;
24
- try {
25
- configParser = new RecipleConfig_1.RecipleConfig(flags_1.flags.config ?? configPath).parseConfig();
26
- }
27
- catch (err) {
28
- console.error(`${chalk_1.default.bold.red('Config Error')}: ${chalk_1.default.white(err.message)}`);
29
- process.exit(1);
30
- }
31
- const config = configParser.getConfig();
32
- const client = new RecipleClient_1.RecipleClient({ config: config, ...config.client });
33
- if (!client.isClientLogsSilent)
34
- client.logger.info('Starting Reciple client v' + version_1.rawVersion);
35
- (async () => {
36
- client.addCommandListeners();
37
- await client.modules.startModulesFromFiles({
38
- files: await client.modules.getModuleFiles(),
39
- });
40
- client.on('ready', async () => {
41
- await client.modules.loadAll(true);
42
- if (!client.isClientLogsSilent)
43
- client.logger.warn(`Logged in as ${client.user?.tag || 'Unknown'}!`);
44
- client.on('cacheSweep', () => client.cooldowns.clean());
45
- });
46
- client.login(config.token).catch(err => {
47
- if (!client.isClientLogsSilent)
48
- client.logger.error(err);
49
- });
50
- })();