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.
- package/LICENSE +674 -674
- package/README.md +183 -183
- package/dist/lib/bin.mjs +70 -0
- package/dist/lib/bin.mjs.map +1 -0
- package/dist/lib/esm.mjs +2 -0
- package/dist/lib/esm.mjs.map +1 -0
- package/dist/{cjs → lib}/index.js +17 -17
- package/dist/lib/index.js.map +1 -0
- package/dist/{cjs → lib}/reciple/classes/RecipleClient.js +42 -33
- package/dist/lib/reciple/classes/RecipleClient.js.map +1 -0
- package/dist/{cjs → lib}/reciple/classes/RecipleConfig.js +11 -10
- package/dist/lib/reciple/classes/RecipleConfig.js.map +1 -0
- package/dist/lib/reciple/classes/RecipleModule.js +137 -0
- package/dist/lib/reciple/classes/RecipleModule.js.map +1 -0
- package/dist/lib/reciple/classes/builders/MessageCommandBuilder.js +310 -0
- package/dist/lib/reciple/classes/builders/MessageCommandBuilder.js.map +1 -0
- package/dist/{cjs → lib}/reciple/classes/builders/MessageCommandOptionBuilder.js +55 -13
- package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js.map +1 -0
- package/dist/{cjs → lib}/reciple/classes/builders/SlashCommandBuilder.js +43 -15
- package/dist/lib/reciple/classes/builders/SlashCommandBuilder.js.map +1 -0
- package/dist/{cjs → lib}/reciple/classes/managers/ApplicationCommandManager.js +69 -27
- package/dist/lib/reciple/classes/managers/ApplicationCommandManager.js.map +1 -0
- package/dist/{cjs → lib}/reciple/classes/managers/CommandCooldownManager.js +1 -1
- package/dist/lib/reciple/classes/managers/CommandCooldownManager.js.map +1 -0
- package/dist/{cjs/reciple/classes/managers/ClientCommandManager.js → lib/reciple/classes/managers/CommandManager.js} +21 -16
- package/dist/lib/reciple/classes/managers/CommandManager.js.map +1 -0
- package/dist/{cjs → lib}/reciple/classes/managers/MessageCommandOptionManager.js +1 -0
- package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js.map +1 -0
- package/dist/lib/reciple/classes/managers/ModuleManager.js +181 -0
- package/dist/lib/reciple/classes/managers/ModuleManager.js.map +1 -0
- package/dist/{cjs → lib}/reciple/flags.js +4 -3
- package/dist/lib/reciple/flags.js.map +1 -0
- package/dist/{cjs → lib}/reciple/permissions.js +1 -0
- package/dist/lib/reciple/permissions.js.map +1 -0
- package/dist/lib/reciple/types/builders.js +12 -0
- package/dist/lib/reciple/types/builders.js.map +1 -0
- package/dist/{cjs → lib}/reciple/types/commands.js +7 -6
- package/dist/lib/reciple/types/commands.js.map +1 -0
- package/dist/{cjs → lib}/reciple/types/paramOptions.js +1 -0
- package/dist/lib/reciple/types/paramOptions.js.map +1 -0
- package/dist/{cjs/reciple/logger.js → lib/reciple/util.js} +40 -5
- package/dist/lib/reciple/util.js.map +1 -0
- package/dist/{cjs → lib}/reciple/version.js +1 -1
- package/dist/lib/reciple/version.js.map +1 -0
- package/dist/types/{bin.d.ts → bin.d.mts} +1 -0
- package/dist/types/bin.d.mts.map +1 -0
- package/dist/types/esm.d.mts +2 -0
- package/dist/types/esm.d.mts.map +1 -0
- package/dist/types/index.d.ts +17 -17
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/reciple/classes/RecipleClient.d.ts +22 -8
- package/dist/types/reciple/classes/RecipleClient.d.ts.map +1 -0
- package/dist/types/reciple/classes/RecipleConfig.d.ts +4 -2
- package/dist/types/reciple/classes/RecipleConfig.d.ts.map +1 -0
- package/dist/types/reciple/classes/RecipleModule.d.ts +88 -0
- package/dist/types/reciple/classes/RecipleModule.d.ts.map +1 -0
- package/dist/types/reciple/classes/builders/MessageCommandBuilder.d.ts +67 -27
- package/dist/types/reciple/classes/builders/MessageCommandBuilder.d.ts.map +1 -0
- package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts +18 -7
- package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts.map +1 -0
- package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts +23 -12
- package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts.map +1 -0
- package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts +46 -12
- package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts.map +1 -0
- package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts +3 -2
- package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts.map +1 -0
- package/dist/types/reciple/classes/managers/CommandManager.d.ts +35 -0
- package/dist/types/reciple/classes/managers/CommandManager.d.ts.map +1 -0
- package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts +2 -1
- package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts.map +1 -0
- package/dist/types/reciple/classes/managers/ModuleManager.d.ts +50 -0
- package/dist/types/reciple/classes/managers/ModuleManager.d.ts.map +1 -0
- package/dist/types/reciple/flags.d.ts +2 -1
- package/dist/types/reciple/flags.d.ts.map +1 -0
- package/dist/types/reciple/permissions.d.ts +3 -6
- package/dist/types/reciple/permissions.d.ts.map +1 -0
- package/dist/types/reciple/types/builders.d.ts +29 -20
- package/dist/types/reciple/types/builders.d.ts.map +1 -0
- package/dist/types/reciple/types/commands.d.ts +19 -18
- package/dist/types/reciple/types/commands.d.ts.map +1 -0
- package/dist/types/reciple/types/paramOptions.d.ts +80 -18
- package/dist/types/reciple/types/paramOptions.d.ts.map +1 -0
- package/dist/types/reciple/util.d.ts +17 -2
- package/dist/types/reciple/util.d.ts.map +1 -0
- package/dist/types/reciple/version.d.ts +1 -0
- package/dist/types/reciple/version.d.ts.map +1 -0
- package/package.json +46 -36
- package/resource/reciple.yml +120 -117
- package/dist/cjs/bin.js +0 -50
- package/dist/cjs/reciple/classes/builders/MessageCommandBuilder.js +0 -242
- package/dist/cjs/reciple/classes/managers/ClientModuleManager.js +0 -193
- package/dist/cjs/reciple/types/builders.js +0 -11
- package/dist/cjs/reciple/util.js +0 -32
- package/dist/types/reciple/classes/managers/ClientCommandManager.d.ts +0 -37
- package/dist/types/reciple/classes/managers/ClientModuleManager.d.ts +0 -79
- package/dist/types/reciple/logger.d.ts +0 -8
- 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
|
|
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
|
-
|
|
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
|
|
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):
|
|
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
|
-
"
|
|
4
|
-
"bin": "./dist/cjs/bin.js",
|
|
3
|
+
"type": "commonjs",
|
|
5
4
|
"license": "GPL-3.0",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"module": "./dist/mjs/index.js",
|
|
5
|
+
"engineStrict": true,
|
|
6
|
+
"version": "6.0.0-dev.30",
|
|
9
7
|
"author": "FalloutStudios",
|
|
10
|
-
"
|
|
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
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
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.
|
|
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/
|
|
64
|
-
"@types/
|
|
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.
|
|
82
|
+
"typescript": "^4.9.3"
|
|
69
83
|
},
|
|
70
84
|
"peerDependencies": {
|
|
71
85
|
"discord.js": "^14.5.0"
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
"test"
|
|
75
|
-
],
|
|
76
|
-
"packageManager": "yarn@3.2.2"
|
|
77
|
-
}
|
|
86
|
+
}
|
|
87
|
+
}
|
package/resource/reciple.yml
CHANGED
|
@@ -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
|
-
#
|
|
8
|
-
|
|
9
|
-
# enable
|
|
10
|
-
enabled: true
|
|
11
|
-
#
|
|
12
|
-
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
# allow
|
|
18
|
-
|
|
19
|
-
#
|
|
20
|
-
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
# enable
|
|
37
|
-
|
|
38
|
-
#
|
|
39
|
-
|
|
40
|
-
#
|
|
41
|
-
|
|
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
|
-
client
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
messages
|
|
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
|
-
#
|
|
117
|
-
|
|
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
|
-
})();
|