xernerx 3.4.2 → 3.5.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.
- package/README.md +10 -10
- package/dist/build/ContextCommandBuilder.js +93 -88
- package/dist/build/EventBuilder.js +34 -35
- package/dist/build/InhibitorBuilder.js +27 -28
- package/dist/build/MessageCommandBuilder.js +90 -80
- package/dist/build/SlashCommandBuilder.js +125 -118
- package/dist/client/XernerxClient.js +101 -81
- package/dist/handlers/CommandHandler.js +42 -42
- package/dist/handlers/EventHandler.js +16 -16
- package/dist/handlers/Handler.js +250 -250
- package/dist/handlers/InhibitorHandler.js +21 -21
- package/dist/main.cjs +2012 -0
- package/dist/main.js +42 -42
- package/dist/models/CommandArguments.js +121 -123
- package/dist/models/Events.js +294 -304
- package/dist/models/Extensions.js +23 -23
- package/dist/tools/XernerxError.js +8 -8
- package/dist/tools/package.js +37 -41
- package/dist/types/enums.js +35 -35
- package/dist/types/interfaces.js +1 -1
- package/dist/types/options.js +1 -1
- package/dist/types/types.js +1 -1
- package/dist/utils/ClientUtil.js +222 -218
- package/dist/utils/CommandUtil.js +248 -260
- package/dist/validators/CommandValidations.js +183 -185
- package/dist/validators/InhibitorValidations.js +42 -42
- package/dist/validators/Shapes.js +1 -0
- package/package.json +54 -39
- package/types/build/ContextCommandBuilder.d.ts +68 -0
- package/{dist → types}/build/EventBuilder.d.ts +21 -17
- package/{dist → types}/build/InhibitorBuilder.d.ts +19 -20
- package/types/build/MessageCommandBuilder.d.ts +59 -0
- package/types/build/SlashCommandBuilder.d.ts +64 -0
- package/{dist → types}/client/XernerxClient.d.ts +28 -28
- package/{dist → types}/handlers/CommandHandler.d.ts +27 -26
- package/{dist → types}/handlers/EventHandler.d.ts +13 -12
- package/{dist → types}/handlers/Handler.d.ts +57 -57
- package/{dist → types}/handlers/InhibitorHandler.d.ts +18 -17
- package/{dist → types}/main.d.ts +44 -30
- package/{dist → types}/models/CommandArguments.d.ts +17 -17
- package/{dist → types}/models/Events.d.ts +24 -24
- package/{dist → types}/models/Extensions.d.ts +7 -7
- package/{dist → types}/tools/XernerxError.d.ts +5 -5
- package/{dist → types}/tools/package.d.ts +38 -38
- package/types/types/enums.d.ts +44 -0
- package/{dist → types}/types/interfaces.d.ts +25 -25
- package/{dist → types}/types/options.d.ts +241 -206
- package/{dist → types}/types/types.d.ts +61 -32
- package/{dist → types}/utils/ClientUtil.d.ts +25 -25
- package/{dist → types}/utils/CommandUtil.d.ts +58 -56
- package/{dist → types}/validators/CommandValidations.d.ts +12 -7
- package/{dist → types}/validators/InhibitorValidations.d.ts +11 -11
- package/types/validators/Shapes.d.ts +1 -0
- package/dist/build/ContextCommandBuilder.d.ts +0 -42
- package/dist/build/MessageCommandBuilder.d.ts +0 -42
- package/dist/build/SlashCommandBuilder.d.ts +0 -40
- package/dist/build/XContextCommandBuilder.d.ts +0 -40
- package/dist/build/XContextCommandBuilder.js +0 -84
- package/dist/build/XEventBuilder.d.ts +0 -17
- package/dist/build/XEventBuilder.js +0 -35
- package/dist/build/XInhibitorBuilder.d.ts +0 -20
- package/dist/build/XInhibitorBuilder.js +0 -28
- package/dist/build/XMessageCommandBuilder.d.ts +0 -42
- package/dist/build/XMessageCommandBuilder.js +0 -80
- package/dist/build/XSlashCommandBuilder.d.ts +0 -36
- package/dist/build/XSlashCommandBuilder.js +0 -114
- package/dist/models/CommandValidations.d.ts +0 -4
- package/dist/models/CommandValidations.js +0 -183
- package/dist/models/InhibitorValidations.d.ts +0 -12
- package/dist/models/InhibitorValidations.js +0 -42
- package/dist/types/enums.d.ts +0 -35
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { Style } from 'dumfunctions';
|
|
2
|
-
export default class Extensions {
|
|
3
|
-
client;
|
|
4
|
-
constructor(client) {
|
|
5
|
-
this.client = client;
|
|
6
|
-
}
|
|
7
|
-
async load(extensions, logging = false) {
|
|
8
|
-
const exts = [];
|
|
9
|
-
extensions.map((extension) => {
|
|
10
|
-
try {
|
|
11
|
-
this.client.extensions[extension.name] = extension;
|
|
12
|
-
exts.push(extension.name);
|
|
13
|
-
}
|
|
14
|
-
catch (error) {
|
|
15
|
-
console.error(Style.log(`Xernerx | An error occurred trying to load ${extension.name}, error: <${error}>`, {
|
|
16
|
-
color: Style.BackgroundColor.Red,
|
|
17
|
-
}));
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
if (logging)
|
|
21
|
-
console.info(Style.log(`Xernerx | Loaded ${exts.length} extensions: ${exts.join(', ')}`, { color: Style.TextColor.Cyan }));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
1
|
+
import { Style } from 'dumfunctions';
|
|
2
|
+
export default class Extensions {
|
|
3
|
+
client;
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
}
|
|
7
|
+
async load(extensions, logging = false) {
|
|
8
|
+
const exts = [];
|
|
9
|
+
extensions.map((extension) => {
|
|
10
|
+
try {
|
|
11
|
+
this.client.extensions[extension.name] = extension;
|
|
12
|
+
exts.push(extension.name);
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
console.error(Style.log(`Xernerx | An error occurred trying to load ${extension.name}, error: <${error}>`, {
|
|
16
|
+
color: Style.BackgroundColor.Red,
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
if (logging)
|
|
21
|
+
console.info(Style.log(`Xernerx | Loaded ${exts.length} extensions: ${exts.join(', ')}`, { color: Style.TextColor.Cyan }));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export default class XernerxError {
|
|
2
|
-
name;
|
|
3
|
-
message;
|
|
4
|
-
constructor(message) {
|
|
5
|
-
this.name = 'XernerxError';
|
|
6
|
-
this.message = message || '';
|
|
7
|
-
}
|
|
8
|
-
}
|
|
1
|
+
export default class XernerxError {
|
|
2
|
+
name;
|
|
3
|
+
message;
|
|
4
|
+
constructor(message) {
|
|
5
|
+
this.name = 'XernerxError';
|
|
6
|
+
this.message = message || '';
|
|
7
|
+
}
|
|
8
|
+
}
|
package/dist/tools/package.js
CHANGED
|
@@ -1,41 +1,37 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"typescript": "^4.9.4"
|
|
40
|
-
}
|
|
41
|
-
};
|
|
1
|
+
export default {
|
|
2
|
+
name: 'xernerx',
|
|
3
|
+
version: '3.4.3',
|
|
4
|
+
type: 'module',
|
|
5
|
+
description: 'A bot framework for discord.js.',
|
|
6
|
+
main: 'dist/main.js',
|
|
7
|
+
keywords: ['discord.js', 'discord', 'framework'],
|
|
8
|
+
author: 'Dummi',
|
|
9
|
+
license: 'MIT',
|
|
10
|
+
homepage: 'https://xernerx.github.io/xernerx/home.html',
|
|
11
|
+
packageManager: 'npm@8.5.5',
|
|
12
|
+
scripts: {
|
|
13
|
+
start: 'npm i && npm fund && npm audit fix --force && npm link && tsc -w',
|
|
14
|
+
patch: 'npm run build && tsc && git add . && npm run commit && npm version patch && npm publish && git push',
|
|
15
|
+
minor: 'npm run build && tsc && git add . && npm run commit && npm version minor && npm publish && git push',
|
|
16
|
+
major: 'npm run build && tsc && git add . && npm run commit && npm version major && npm publish && git push',
|
|
17
|
+
site: 'git add docs && npm run commit && git push',
|
|
18
|
+
commit: 'node ../.scripts/commit.js',
|
|
19
|
+
build: 'node ../.scripts/rewritePackage.js',
|
|
20
|
+
},
|
|
21
|
+
repository: {
|
|
22
|
+
type: 'git',
|
|
23
|
+
url: 'git+https://github.com/xernerx/xernerx.git',
|
|
24
|
+
},
|
|
25
|
+
bugs: {
|
|
26
|
+
url: 'https://github.com/xernerx/xernerx/issues',
|
|
27
|
+
},
|
|
28
|
+
dependencies: {
|
|
29
|
+
'@sapphire/shapeshift': '^3.8.1',
|
|
30
|
+
'discord.js': '^14.7.0',
|
|
31
|
+
dumfunctions: '^2.0.0',
|
|
32
|
+
'xernerx-extension-builder': '^0.0.2',
|
|
33
|
+
},
|
|
34
|
+
devDependencies: {
|
|
35
|
+
typescript: '^4.9.4',
|
|
36
|
+
},
|
|
37
|
+
};
|
package/dist/types/enums.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
export var InhibitorType;
|
|
2
|
-
(function (InhibitorType) {
|
|
3
|
-
InhibitorType["Member"] = "Member";
|
|
4
|
-
InhibitorType["User"] = "User";
|
|
5
|
-
InhibitorType["Guild"] = "Guild";
|
|
6
|
-
InhibitorType["SlashCommand"] = "SlashCommand";
|
|
7
|
-
InhibitorType["MessageCommand"] = "MessageCommand";
|
|
8
|
-
InhibitorType["ContextCommand"] = "ContextCommand";
|
|
9
|
-
InhibitorType["Command"] = "Command";
|
|
10
|
-
InhibitorType["Message"] = "Message";
|
|
11
|
-
InhibitorType["Interaction"] = "Interaction";
|
|
12
|
-
InhibitorType["Channel"] = "Channel";
|
|
13
|
-
})(InhibitorType || (InhibitorType = {}));
|
|
14
|
-
export var CommandType;
|
|
15
|
-
(function (CommandType) {
|
|
16
|
-
CommandType["Message"] = "MessageCommand";
|
|
17
|
-
CommandType["Slash"] = "SlashCommand";
|
|
18
|
-
CommandType["Context"] = "ContextCommand";
|
|
19
|
-
CommandType["Event"] = "Event";
|
|
20
|
-
CommandType["Inhibitor"] = "Inhibitor";
|
|
21
|
-
CommandType["MessageCommand"] = "MessageCommand";
|
|
22
|
-
CommandType["SlashCommand"] = "SlashCommand";
|
|
23
|
-
CommandType["ContextCommand"] = "ContextCommand";
|
|
24
|
-
})(CommandType || (CommandType = {}));
|
|
25
|
-
export var ContextCommandType;
|
|
26
|
-
(function (ContextCommandType) {
|
|
27
|
-
ContextCommandType[ContextCommandType["Message"] = 3] = "Message";
|
|
28
|
-
ContextCommandType[ContextCommandType["User"] = 2] = "User";
|
|
29
|
-
})(ContextCommandType || (ContextCommandType = {}));
|
|
30
|
-
export var EventEmitterType;
|
|
31
|
-
(function (EventEmitterType) {
|
|
32
|
-
EventEmitterType["Client"] = "client";
|
|
33
|
-
EventEmitterType["Rest"] = "rest";
|
|
34
|
-
EventEmitterType["Process"] = "process";
|
|
35
|
-
})(EventEmitterType || (EventEmitterType = {}));
|
|
1
|
+
export var InhibitorType;
|
|
2
|
+
(function (InhibitorType) {
|
|
3
|
+
InhibitorType["Member"] = "Member";
|
|
4
|
+
InhibitorType["User"] = "User";
|
|
5
|
+
InhibitorType["Guild"] = "Guild";
|
|
6
|
+
InhibitorType["SlashCommand"] = "SlashCommand";
|
|
7
|
+
InhibitorType["MessageCommand"] = "MessageCommand";
|
|
8
|
+
InhibitorType["ContextCommand"] = "ContextCommand";
|
|
9
|
+
InhibitorType["Command"] = "Command";
|
|
10
|
+
InhibitorType["Message"] = "Message";
|
|
11
|
+
InhibitorType["Interaction"] = "Interaction";
|
|
12
|
+
InhibitorType["Channel"] = "Channel";
|
|
13
|
+
})(InhibitorType = InhibitorType || (InhibitorType = {}));
|
|
14
|
+
export var CommandType;
|
|
15
|
+
(function (CommandType) {
|
|
16
|
+
CommandType["Message"] = "MessageCommand";
|
|
17
|
+
CommandType["Slash"] = "SlashCommand";
|
|
18
|
+
CommandType["Context"] = "ContextCommand";
|
|
19
|
+
CommandType["Event"] = "Event";
|
|
20
|
+
CommandType["Inhibitor"] = "Inhibitor";
|
|
21
|
+
CommandType["MessageCommand"] = "MessageCommand";
|
|
22
|
+
CommandType["SlashCommand"] = "SlashCommand";
|
|
23
|
+
CommandType["ContextCommand"] = "ContextCommand";
|
|
24
|
+
})(CommandType = CommandType || (CommandType = {}));
|
|
25
|
+
export var ContextCommandType;
|
|
26
|
+
(function (ContextCommandType) {
|
|
27
|
+
ContextCommandType[ContextCommandType["Message"] = 3] = "Message";
|
|
28
|
+
ContextCommandType[ContextCommandType["User"] = 2] = "User";
|
|
29
|
+
})(ContextCommandType = ContextCommandType || (ContextCommandType = {}));
|
|
30
|
+
export var EventEmitterType;
|
|
31
|
+
(function (EventEmitterType) {
|
|
32
|
+
EventEmitterType["Client"] = "client";
|
|
33
|
+
EventEmitterType["Rest"] = "rest";
|
|
34
|
+
EventEmitterType["Process"] = "process";
|
|
35
|
+
})(EventEmitterType = EventEmitterType || (EventEmitterType = {}));
|
package/dist/types/interfaces.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/types/options.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/types/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|