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.
Files changed (71) hide show
  1. package/README.md +10 -10
  2. package/dist/build/ContextCommandBuilder.js +93 -88
  3. package/dist/build/EventBuilder.js +34 -35
  4. package/dist/build/InhibitorBuilder.js +27 -28
  5. package/dist/build/MessageCommandBuilder.js +90 -80
  6. package/dist/build/SlashCommandBuilder.js +125 -118
  7. package/dist/client/XernerxClient.js +101 -81
  8. package/dist/handlers/CommandHandler.js +42 -42
  9. package/dist/handlers/EventHandler.js +16 -16
  10. package/dist/handlers/Handler.js +250 -250
  11. package/dist/handlers/InhibitorHandler.js +21 -21
  12. package/dist/main.cjs +2012 -0
  13. package/dist/main.js +42 -42
  14. package/dist/models/CommandArguments.js +121 -123
  15. package/dist/models/Events.js +294 -304
  16. package/dist/models/Extensions.js +23 -23
  17. package/dist/tools/XernerxError.js +8 -8
  18. package/dist/tools/package.js +37 -41
  19. package/dist/types/enums.js +35 -35
  20. package/dist/types/interfaces.js +1 -1
  21. package/dist/types/options.js +1 -1
  22. package/dist/types/types.js +1 -1
  23. package/dist/utils/ClientUtil.js +222 -218
  24. package/dist/utils/CommandUtil.js +248 -260
  25. package/dist/validators/CommandValidations.js +183 -185
  26. package/dist/validators/InhibitorValidations.js +42 -42
  27. package/dist/validators/Shapes.js +1 -0
  28. package/package.json +54 -39
  29. package/types/build/ContextCommandBuilder.d.ts +68 -0
  30. package/{dist → types}/build/EventBuilder.d.ts +21 -17
  31. package/{dist → types}/build/InhibitorBuilder.d.ts +19 -20
  32. package/types/build/MessageCommandBuilder.d.ts +59 -0
  33. package/types/build/SlashCommandBuilder.d.ts +64 -0
  34. package/{dist → types}/client/XernerxClient.d.ts +28 -28
  35. package/{dist → types}/handlers/CommandHandler.d.ts +27 -26
  36. package/{dist → types}/handlers/EventHandler.d.ts +13 -12
  37. package/{dist → types}/handlers/Handler.d.ts +57 -57
  38. package/{dist → types}/handlers/InhibitorHandler.d.ts +18 -17
  39. package/{dist → types}/main.d.ts +44 -30
  40. package/{dist → types}/models/CommandArguments.d.ts +17 -17
  41. package/{dist → types}/models/Events.d.ts +24 -24
  42. package/{dist → types}/models/Extensions.d.ts +7 -7
  43. package/{dist → types}/tools/XernerxError.d.ts +5 -5
  44. package/{dist → types}/tools/package.d.ts +38 -38
  45. package/types/types/enums.d.ts +44 -0
  46. package/{dist → types}/types/interfaces.d.ts +25 -25
  47. package/{dist → types}/types/options.d.ts +241 -206
  48. package/{dist → types}/types/types.d.ts +61 -32
  49. package/{dist → types}/utils/ClientUtil.d.ts +25 -25
  50. package/{dist → types}/utils/CommandUtil.d.ts +58 -56
  51. package/{dist → types}/validators/CommandValidations.d.ts +12 -7
  52. package/{dist → types}/validators/InhibitorValidations.d.ts +11 -11
  53. package/types/validators/Shapes.d.ts +1 -0
  54. package/dist/build/ContextCommandBuilder.d.ts +0 -42
  55. package/dist/build/MessageCommandBuilder.d.ts +0 -42
  56. package/dist/build/SlashCommandBuilder.d.ts +0 -40
  57. package/dist/build/XContextCommandBuilder.d.ts +0 -40
  58. package/dist/build/XContextCommandBuilder.js +0 -84
  59. package/dist/build/XEventBuilder.d.ts +0 -17
  60. package/dist/build/XEventBuilder.js +0 -35
  61. package/dist/build/XInhibitorBuilder.d.ts +0 -20
  62. package/dist/build/XInhibitorBuilder.js +0 -28
  63. package/dist/build/XMessageCommandBuilder.d.ts +0 -42
  64. package/dist/build/XMessageCommandBuilder.js +0 -80
  65. package/dist/build/XSlashCommandBuilder.d.ts +0 -36
  66. package/dist/build/XSlashCommandBuilder.js +0 -114
  67. package/dist/models/CommandValidations.d.ts +0 -4
  68. package/dist/models/CommandValidations.js +0 -183
  69. package/dist/models/InhibitorValidations.d.ts +0 -12
  70. package/dist/models/InhibitorValidations.js +0 -42
  71. 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
+ }
@@ -1,41 +1,37 @@
1
- export default {
2
- "name": "xernerx",
3
- "version": "3.4.2",
4
- "type": "module",
5
- "description": "A bot framework for discord.js.",
6
- "main": "dist/main.js",
7
- "keywords": [
8
- "discord.js",
9
- "discord",
10
- "framework"
11
- ],
12
- "author": "Dummi",
13
- "license": "MIT",
14
- "homepage": "https://xernerx.github.io/xernerx/home.html",
15
- "packageManager": "npm@8.5.5",
16
- "scripts": {
17
- "start": "npm i && npm fund && npm audit fix --force && npm link && tsc -w",
18
- "patch": "npm run build && tsc && git add . && npm run commit && npm version patch && npm publish && git push",
19
- "minor": "npm run build && tsc && git add . && npm run commit && npm version minor && npm publish && git push",
20
- "major": "npm run build && tsc && git add . && npm run commit && npm version major && npm publish && git push",
21
- "site": "git add docs && npm run commit && git push",
22
- "commit": "node ../.scripts/commit.js",
23
- "build": "node ../.scripts/rewritePackage.js"
24
- },
25
- "repository": {
26
- "type": "git",
27
- "url": "git+https://github.com/xernerx/xernerx.git"
28
- },
29
- "bugs": {
30
- "url": "https://github.com/xernerx/xernerx/issues"
31
- },
32
- "dependencies": {
33
- "@sapphire/shapeshift": "^3.8.1",
34
- "discord.js": "^14.7.0",
35
- "dumfunctions": "^2.0.0",
36
- "xernerx-extension-builder": "^0.0.2"
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
+ };
@@ -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 = {}));
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};