xernerx 4.5.6 → 4.5.8
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/dist/build/XernerxContextCommand.d.ts +46 -46
- package/dist/build/XernerxContextCommand.d.ts.map +1 -1
- package/dist/build/XernerxContextCommand.js +63 -63
- package/dist/build/XernerxContextCommand.js.map +1 -1
- package/dist/build/XernerxEvent.d.ts +16 -15
- package/dist/build/XernerxEvent.d.ts.map +1 -1
- package/dist/build/XernerxEvent.js +20 -20
- package/dist/build/XernerxEvent.js.map +1 -1
- package/dist/build/XernerxInhibitor.d.ts +19 -19
- package/dist/build/XernerxInhibitor.d.ts.map +1 -1
- package/dist/build/XernerxInhibitor.js +12 -12
- package/dist/build/XernerxInhibitor.js.map +1 -1
- package/dist/build/XernerxMessageCommand.d.ts +44 -44
- package/dist/build/XernerxMessageCommand.d.ts.map +1 -1
- package/dist/build/XernerxMessageCommand.js +57 -57
- package/dist/build/XernerxMessageCommand.js.map +1 -1
- package/dist/build/XernerxSlashCommand.d.ts +56 -56
- package/dist/build/XernerxSlashCommand.d.ts.map +1 -1
- package/dist/build/XernerxSlashCommand.js +109 -109
- package/dist/build/XernerxSlashCommand.js.map +1 -1
- package/dist/client/XernerxClient.d.ts +45 -44
- package/dist/client/XernerxClient.d.ts.map +1 -1
- package/dist/client/XernerxClient.js +74 -73
- package/dist/client/XernerxClient.js.map +1 -1
- package/dist/client/XernerxShardClient.d.ts +11 -10
- package/dist/client/XernerxShardClient.d.ts.map +1 -1
- package/dist/client/XernerxShardClient.js +49 -48
- package/dist/client/XernerxShardClient.js.map +1 -1
- package/dist/functions/deploy.d.ts +1 -0
- package/dist/functions/deploy.d.ts.map +1 -1
- package/dist/functions/deploy.js +31 -30
- package/dist/functions/deploy.js.map +1 -1
- package/dist/functions/load.d.ts +1 -0
- package/dist/functions/load.d.ts.map +1 -1
- package/dist/functions/load.js +28 -27
- package/dist/functions/load.js.map +1 -1
- package/dist/functions/reload.d.ts +1 -0
- package/dist/functions/reload.d.ts.map +1 -1
- package/dist/functions/reload.js +35 -34
- package/dist/functions/reload.js.map +1 -1
- package/dist/functions/sendWebhook.d.ts +1 -0
- package/dist/functions/sendWebhook.d.ts.map +1 -1
- package/dist/functions/sendWebhook.js +11 -10
- package/dist/functions/sendWebhook.js.map +1 -1
- package/dist/functions/setPresence.d.ts +1 -0
- package/dist/functions/setPresence.d.ts.map +1 -1
- package/dist/functions/setPresence.js +18 -17
- package/dist/functions/setPresence.js.map +1 -1
- package/dist/functions/xernerxUser.d.ts +1 -0
- package/dist/functions/xernerxUser.d.ts.map +1 -1
- package/dist/functions/xernerxUser.js +6 -8
- package/dist/functions/xernerxUser.js.map +1 -1
- package/dist/handlers/CommandHandler.d.ts +9 -8
- package/dist/handlers/CommandHandler.d.ts.map +1 -1
- package/dist/handlers/CommandHandler.js +240 -239
- package/dist/handlers/CommandHandler.js.map +1 -1
- package/dist/handlers/EventHandler.d.ts +3 -2
- package/dist/handlers/EventHandler.d.ts.map +1 -1
- package/dist/handlers/EventHandler.js +19 -18
- package/dist/handlers/EventHandler.js.map +1 -1
- package/dist/handlers/ExtensionHandler.d.ts +3 -2
- package/dist/handlers/ExtensionHandler.d.ts.map +1 -1
- package/dist/handlers/ExtensionHandler.js +18 -17
- package/dist/handlers/ExtensionHandler.js.map +1 -1
- package/dist/handlers/Handler.d.ts +8 -7
- package/dist/handlers/Handler.d.ts.map +1 -1
- package/dist/handlers/Handler.js +32 -31
- package/dist/handlers/Handler.js.map +1 -1
- package/dist/handlers/InhibitorHandler.d.ts +3 -2
- package/dist/handlers/InhibitorHandler.d.ts.map +1 -1
- package/dist/handlers/InhibitorHandler.js +19 -18
- package/dist/handlers/InhibitorHandler.js.map +1 -1
- package/dist/handlers/WebhookHandler.d.ts +4 -3
- package/dist/handlers/WebhookHandler.d.ts.map +1 -1
- package/dist/handlers/WebhookHandler.js +47 -46
- package/dist/handlers/WebhookHandler.js.map +1 -1
- package/dist/main.d.ts +27 -26
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +27 -26
- package/dist/main.js.map +1 -1
- package/dist/models/Arguments.d.ts +3 -2
- package/dist/models/Arguments.d.ts.map +1 -1
- package/dist/models/Arguments.js +135 -134
- package/dist/models/Arguments.js.map +1 -1
- package/dist/tools/XernerxError.d.ts +5 -4
- package/dist/tools/XernerxError.d.ts.map +1 -1
- package/dist/tools/XernerxError.js +9 -8
- package/dist/tools/XernerxError.js.map +1 -1
- package/dist/tools/XernerxLog.d.ts +13 -12
- package/dist/tools/XernerxLog.d.ts.map +1 -1
- package/dist/tools/XernerxLog.js +76 -80
- package/dist/tools/XernerxLog.js.map +1 -1
- package/dist/types/extenders.d.ts +43 -12
- package/dist/types/extenders.d.ts.map +1 -1
- package/dist/types/extenders.js +1 -0
- package/dist/types/extenders.js.map +1 -1
- package/dist/types/interfaces.d.ts +186 -172
- package/dist/types/interfaces.d.ts.map +1 -1
- package/dist/types/interfaces.js +1 -0
- package/dist/types/interfaces.js.map +1 -1
- package/dist/types/types.d.ts +172 -171
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js +1 -0
- package/dist/types/types.js.map +1 -1
- package/dist/utils/ClientUtil.d.ts +13 -6
- package/dist/utils/ClientUtil.d.ts.map +1 -1
- package/dist/utils/ClientUtil.js +56 -26
- package/dist/utils/ClientUtil.js.map +1 -1
- package/dist/utils/InteractionUtil.d.ts +10 -5
- package/dist/utils/InteractionUtil.d.ts.map +1 -1
- package/dist/utils/InteractionUtil.js +97 -8
- package/dist/utils/InteractionUtil.js.map +1 -1
- package/dist/utils/MessageUtil.d.ts +13 -9
- package/dist/utils/MessageUtil.d.ts.map +1 -1
- package/dist/utils/MessageUtil.js +130 -37
- package/dist/utils/MessageUtil.js.map +1 -1
- package/dist/utils/Util.d.ts +4 -3
- package/dist/utils/Util.d.ts.map +1 -1
- package/dist/utils/Util.js +8 -7
- package/dist/utils/Util.js.map +1 -1
- package/dist/validators/commandValidation.d.ts +3 -2
- package/dist/validators/commandValidation.d.ts.map +1 -1
- package/dist/validators/commandValidation.js +43 -42
- package/dist/validators/commandValidation.js.map +1 -1
- package/dist/validators/inhibitorValidations.d.ts +15 -14
- package/dist/validators/inhibitorValidations.d.ts.map +1 -1
- package/dist/validators/inhibitorValidations.js +31 -30
- package/dist/validators/inhibitorValidations.js.map +1 -1
- package/package.json +1 -1
package/dist/functions/load.js
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
|
+
/** @format */
|
|
1
2
|
import XernerxLog from '../tools/XernerxLog.js';
|
|
2
3
|
export default async function load(client, path, type) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
try {
|
|
5
|
+
let file = new (await import(`file://${path}`)).default();
|
|
6
|
+
file.fileType = type;
|
|
7
|
+
file.filePath = path;
|
|
8
|
+
file.client = client;
|
|
9
|
+
fileSave(client, file, type);
|
|
10
|
+
return file;
|
|
11
|
+
} catch (error) {
|
|
12
|
+
new XernerxLog(client).error(`Couldn't load ${type} ${path.match(/\w*\.js$/gim)?.at(0) || path}`, error);
|
|
13
|
+
}
|
|
13
14
|
}
|
|
14
15
|
function fileSave(client, file, type) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
16
|
+
switch (type) {
|
|
17
|
+
case 'MessageCommand':
|
|
18
|
+
client.commands.message.set(file.name, file);
|
|
19
|
+
break;
|
|
20
|
+
case 'SlashCommand':
|
|
21
|
+
client.commands.slash.set(file.name, file);
|
|
22
|
+
break;
|
|
23
|
+
case 'ContextCommand':
|
|
24
|
+
client.commands.context.set(file.name, file);
|
|
25
|
+
break;
|
|
26
|
+
case 'Inhibitor':
|
|
27
|
+
client.inhibitors.set(file.name, file);
|
|
28
|
+
break;
|
|
29
|
+
case 'Event':
|
|
30
|
+
client.events.set(file.name, file);
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
32
33
|
}
|
|
33
34
|
//# sourceMappingURL=load.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/functions/load.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/functions/load.ts"],"names":[],"mappings":"AAAA,cAAc;AASd,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,IAAI,CAAC,MAAqB,EAAE,IAAY,EAAE,IAAc;IACrF,IAAI;QACH,IAAI,IAAI,GAAG,IAAI,CAAC,MAAM,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAE1D,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAE7B,OAAO,IAAI,CAAC;KACZ;IAAC,OAAO,KAAK,EAAE;QACf,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,iBAAiB,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;KACzG;AACF,CAAC;AAED,SAAS,QAAQ,CAAC,MAAqB,EAAE,IAA2G,EAAE,IAAc;IACnK,QAAQ,IAAI,EAAE;QACb,KAAK,gBAAgB;YACpB,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAA6B,CAAC,CAAC;YACtE,MAAM;QACP,KAAK,cAAc;YAClB,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAA2B,CAAC,CAAC;YAClE,MAAM;QACP,KAAK,gBAAgB;YACpB,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAA6B,CAAC,CAAC;YACtE,MAAM;QACP,KAAK,WAAW;YACf,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAwB,CAAC,CAAC;YAC3D,MAAM;QACP,KAAK,OAAO;YACX,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAoB,CAAC,CAAC;YACnD,MAAM;KACP;AACF,CAAC","sourcesContent":["/** @format */\n\nimport XernerxInhibitor from '../build/XernerxInhibitor.js';\nimport XernerxSlashCommand from '../build/XernerxSlashCommand.js';\nimport XernerxContextCommand from '../build/XernerxContextCommand.js';\nimport MessageCommandBuilder from '../build/XernerxMessageCommand.js';\nimport XernerxEvent from '../build/XernerxEvent.js';\nimport XernerxClient from '../client/XernerxClient.js';\nimport { FileType } from '../types/types.js';\nimport XernerxLog from '../tools/XernerxLog.js';\n\nexport default async function load(client: XernerxClient, path: string, type: FileType) {\n\ttry {\n\t\tlet file = new (await import(`file://${path}`)).default();\n\n\t\tfile.fileType = type;\n\n\t\tfile.filePath = path;\n\n\t\tfile.client = client;\n\n\t\tfileSave(client, file, type);\n\n\t\treturn file;\n\t} catch (error) {\n\t\tnew XernerxLog(client).error(`Couldn't load ${type} ${path.match(/\\w*\\.js$/gim)?.at(0) || path}`, error);\n\t}\n}\n\nfunction fileSave(client: XernerxClient, file: MessageCommandBuilder | XernerxSlashCommand | XernerxContextCommand | XernerxEvent | XernerxInhibitor, type: FileType) {\n\tswitch (type) {\n\t\tcase 'MessageCommand':\n\t\t\tclient.commands.message.set(file.name, file as MessageCommandBuilder);\n\t\t\tbreak;\n\t\tcase 'SlashCommand':\n\t\t\tclient.commands.slash.set(file.name, file as XernerxSlashCommand);\n\t\t\tbreak;\n\t\tcase 'ContextCommand':\n\t\t\tclient.commands.context.set(file.name, file as XernerxContextCommand);\n\t\t\tbreak;\n\t\tcase 'Inhibitor':\n\t\t\tclient.inhibitors.set(file.name, file as XernerxInhibitor);\n\t\t\tbreak;\n\t\tcase 'Event':\n\t\t\tclient.events.set(file.name, file as XernerxEvent);\n\t\t\tbreak;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reload.d.ts","sourceRoot":"","sources":["../../src/functions/reload.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAUvD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,kBA4ClH"}
|
|
1
|
+
{"version":3,"file":"reload.d.ts","sourceRoot":"","sources":["../../src/functions/reload.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAUvD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,kBA4ClH"}
|
package/dist/functions/reload.js
CHANGED
|
@@ -1,40 +1,41 @@
|
|
|
1
|
+
/** @format */
|
|
1
2
|
var FileTypes;
|
|
2
3
|
(function (FileTypes) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
FileTypes['message'] = 'MessageCommand';
|
|
5
|
+
FileTypes['slash'] = 'SlashCommand';
|
|
6
|
+
FileTypes['context'] = 'ContextCommand';
|
|
7
|
+
FileTypes['event'] = 'Event';
|
|
8
|
+
FileTypes['inhibitor'] = 'Inhibitor';
|
|
8
9
|
})(FileTypes || (FileTypes = {}));
|
|
9
10
|
export default function reload(client, type) {
|
|
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
|
-
|
|
11
|
+
const files = [];
|
|
12
|
+
if (type === 'message' || type === 'slash' || type === 'context') {
|
|
13
|
+
for (const [name] of client.commands[type]) {
|
|
14
|
+
files.push(client.commands[type].get(name).filePath);
|
|
15
|
+
}
|
|
16
|
+
client.commands[type].sweep(() => true);
|
|
17
|
+
}
|
|
18
|
+
if (type === 'event') {
|
|
19
|
+
for (const [name] of client.events) {
|
|
20
|
+
files.push(client.events.get(name).filePath);
|
|
21
|
+
}
|
|
22
|
+
client.events.sweep(() => true);
|
|
23
|
+
}
|
|
24
|
+
if (type === 'inhibitor') {
|
|
25
|
+
for (const [name] of client.inhibitors) {
|
|
26
|
+
files.push(client.inhibitors.get(name).filePath);
|
|
27
|
+
}
|
|
28
|
+
client.inhibitors.sweep(() => true);
|
|
29
|
+
}
|
|
30
|
+
return files.map(async (file) => {
|
|
31
|
+
let filedata = new (await import(`file://${file}`)).default();
|
|
32
|
+
filedata.fileType = FileTypes[type];
|
|
33
|
+
filedata.filePath = file;
|
|
34
|
+
filedata.client = client;
|
|
35
|
+
if (type === 'message' || type === 'slash' || type === 'context') client.commands[type].set(filedata.name, filedata);
|
|
36
|
+
if (type === 'event') client.events.set(filedata.name, filedata);
|
|
37
|
+
if (type === 'inhibitor') client.inhibitors.set(filedata.name, filedata);
|
|
38
|
+
return filedata;
|
|
39
|
+
});
|
|
39
40
|
}
|
|
40
41
|
//# sourceMappingURL=reload.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reload.js","sourceRoot":"","sources":["../../src/functions/reload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reload.js","sourceRoot":"","sources":["../../src/functions/reload.ts"],"names":[],"mappings":"AAAA,cAAc;AAId,IAAK,SAMJ;AAND,WAAK,SAAS;IACb,uCAA4B,CAAA;IAC5B,mCAAwB,CAAA;IACxB,uCAA4B,CAAA;IAC5B,4BAAiB,CAAA;IACjB,oCAAyB,CAAA;AAC1B,CAAC,EANI,SAAS,KAAT,SAAS,QAMb;AAED,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,MAAqB,EAAE,IAA6D;IAClH,MAAM,KAAK,GAAkB,EAAE,CAAC;IAEhC,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,SAAS,EAAE;QACjE,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAC3C,KAAK,CAAC,IAAI,CAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAuC,CAAC,QAAQ,CAAC,CAAC;SAC5F;QAEA,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAkB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;KACtD;IAED,IAAI,IAAI,KAAK,OAAO,EAAE;QACrB,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE;YACnC,KAAK,CAAC,IAAI,CAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAuC,CAAC,QAAQ,CAAC,CAAC;SACpF;QAEA,MAAM,CAAC,MAAM,CAAC,KAAkB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;KAC9C;IAED,IAAI,IAAI,KAAK,WAAW,EAAE;QACzB,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,UAAU,EAAE;YACvC,KAAK,CAAC,IAAI,CAAE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAuC,CAAC,QAAQ,CAAC,CAAC;SACxF;QAEA,MAAM,CAAC,UAAU,CAAC,KAAkB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;KAClD;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAC/B,IAAI,QAAQ,GAAG,IAAI,CAAC,MAAM,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAE9D,QAAQ,CAAC,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;QAEpC,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC;QAEzB,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;QAEzB,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,SAAS;YAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAErH,IAAI,IAAI,KAAK,OAAO;YAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAEjE,IAAI,IAAI,KAAK,WAAW;YAAE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAEzE,OAAO,QAAQ,CAAC;IACjB,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/** @format */\n\nimport XernerxClient from '../client/XernerxClient.js';\n\nenum FileTypes {\n\t'message' = 'MessageCommand',\n\t'slash' = 'SlashCommand',\n\t'context' = 'ContextCommand',\n\t'event' = 'Event',\n\t'inhibitor' = 'Inhibitor',\n}\n\nexport default function reload(client: XernerxClient, type: 'message' | 'slash' | 'context' | 'event' | 'inhibitor') {\n\tconst files: Array<string> = [];\n\n\tif (type === 'message' || type === 'slash' || type === 'context') {\n\t\tfor (const [name] of client.commands[type]) {\n\t\t\tfiles.push((client.commands[type].get(name) as unknown as Record<string, string>).filePath);\n\t\t}\n\n\t\t(client.commands[type].sweep as Function)(() => true);\n\t}\n\n\tif (type === 'event') {\n\t\tfor (const [name] of client.events) {\n\t\t\tfiles.push((client.events.get(name) as unknown as Record<string, string>).filePath);\n\t\t}\n\n\t\t(client.events.sweep as Function)(() => true);\n\t}\n\n\tif (type === 'inhibitor') {\n\t\tfor (const [name] of client.inhibitors) {\n\t\t\tfiles.push((client.inhibitors.get(name) as unknown as Record<string, string>).filePath);\n\t\t}\n\n\t\t(client.inhibitors.sweep as Function)(() => true);\n\t}\n\n\treturn files.map(async (file) => {\n\t\tlet filedata = new (await import(`file://${file}`)).default();\n\n\t\tfiledata.fileType = FileTypes[type];\n\n\t\tfiledata.filePath = file;\n\n\t\tfiledata.client = client;\n\n\t\tif (type === 'message' || type === 'slash' || type === 'context') client.commands[type].set(filedata.name, filedata);\n\n\t\tif (type === 'event') client.events.set(filedata.name, filedata);\n\n\t\tif (type === 'inhibitor') client.inhibitors.set(filedata.name, filedata);\n\n\t\treturn filedata;\n\t});\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendWebhook.d.ts","sourceRoot":"","sources":["../../src/functions/sendWebhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,wBAA8B,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,cAAc,gBAcvE"}
|
|
1
|
+
{"version":3,"file":"sendWebhook.d.ts","sourceRoot":"","sources":["../../src/functions/sendWebhook.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,wBAA8B,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,cAAc,gBAcvE"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
/** @format */
|
|
1
2
|
export default async function sendWebhook(url, body) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
const response = await fetch(url, {
|
|
4
|
+
method: 'POST',
|
|
5
|
+
headers: {
|
|
6
|
+
'Content-Type': 'application/json',
|
|
7
|
+
},
|
|
8
|
+
body: JSON.stringify(body),
|
|
9
|
+
});
|
|
10
|
+
if (response.status === 204) return true;
|
|
11
|
+
const data = await response.json();
|
|
12
|
+
return data;
|
|
12
13
|
}
|
|
13
14
|
//# sourceMappingURL=sendWebhook.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendWebhook.js","sourceRoot":"","sources":["../../src/functions/sendWebhook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sendWebhook.js","sourceRoot":"","sources":["../../src/functions/sendWebhook.ts"],"names":[],"mappings":"AAAA,cAAc;AAId,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,WAAW,CAAC,GAAQ,EAAE,IAAoB;IACvE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QACjC,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACR,cAAc,EAAE,kBAAkB;SAClC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC1B,CAAC,CAAC;IAEH,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC;IAEzC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAEnC,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["/** @format */\n\nimport { MessagePayload } from 'discord.js';\n\nexport default async function sendWebhook(url: URL, body: MessagePayload) {\n\tconst response = await fetch(url, {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json',\n\t\t},\n\t\tbody: JSON.stringify(body),\n\t});\n\n\tif (response.status === 204) return true;\n\n\tconst data = await response.json();\n\n\treturn data;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setPresence.d.ts","sourceRoot":"","sources":["../../src/functions/setPresence.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,mDAqBlF"}
|
|
1
|
+
{"version":3,"file":"setPresence.d.ts","sourceRoot":"","sources":["../../src/functions/setPresence.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,aAAa,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,mDAqBlF"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
+
/** @format */
|
|
1
2
|
export default function setPresence(client, options) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
const presence = () =>
|
|
4
|
+
client.user?.setPresence({
|
|
5
|
+
activities: [
|
|
6
|
+
{
|
|
7
|
+
name: options.text,
|
|
8
|
+
type: options.type,
|
|
9
|
+
url: options.url,
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
status: options.status,
|
|
13
|
+
});
|
|
14
|
+
let response = presence();
|
|
15
|
+
if (options.interval)
|
|
16
|
+
setInterval(() => {
|
|
17
|
+
response = presence();
|
|
18
|
+
}, options.interval);
|
|
19
|
+
return response;
|
|
19
20
|
}
|
|
20
21
|
//# sourceMappingURL=setPresence.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setPresence.js","sourceRoot":"","sources":["../../src/functions/setPresence.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setPresence.js","sourceRoot":"","sources":["../../src/functions/setPresence.ts"],"names":[],"mappings":"AAAA,cAAc;AAKd,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,MAAqB,EAAE,OAAwB;IAClF,MAAM,QAAQ,GAAG,GAAG,EAAE,CACrB,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC;QACxB,UAAU,EAAE;YACX;gBACC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,GAAG,EAAE,OAAO,CAAC,GAAG;aAChB;SACD;QACD,MAAM,EAAE,OAAO,CAAC,MAAM;KACtB,CAAC,CAAC;IAEJ,IAAI,QAAQ,GAAG,QAAQ,EAAE,CAAC;IAE1B,IAAI,OAAO,CAAC,QAAQ;QACnB,WAAW,CAAC,GAAG,EAAE;YAChB,QAAQ,GAAG,QAAQ,EAAE,CAAC;QACvB,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEtB,OAAO,QAAQ,CAAC;AACjB,CAAC","sourcesContent":["/** @format */\n\nimport XernerxClient from '../main.js';\nimport { PresenceOptions } from '../types/interfaces.js';\n\nexport default function setPresence(client: XernerxClient, options: PresenceOptions) {\n\tconst presence = () =>\n\t\tclient.user?.setPresence({\n\t\t\tactivities: [\n\t\t\t\t{\n\t\t\t\t\tname: options.text,\n\t\t\t\t\ttype: options.type,\n\t\t\t\t\turl: options.url,\n\t\t\t\t},\n\t\t\t],\n\t\t\tstatus: options.status,\n\t\t});\n\n\tlet response = presence();\n\n\tif (options.interval)\n\t\tsetInterval(() => {\n\t\t\tresponse = presence();\n\t\t}, options.interval);\n\n\treturn response;\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @format */
|
|
1
2
|
import XernerxClient from '../client/XernerxClient.js';
|
|
2
3
|
import { XernerxMessage, XernerxSlashInteraction, XernerxUser, XernerxUserContextInteraction } from '../types/extenders.js';
|
|
3
4
|
export declare function xernerxUser(event: XernerxMessage | XernerxSlashInteraction | XernerxUserContextInteraction | XernerxUserContextInteraction, client: XernerxClient): Promise<XernerxUser>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xernerxUser.d.ts","sourceRoot":"","sources":["../../src/functions/xernerxUser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"xernerxUser.d.ts","sourceRoot":"","sources":["../../src/functions/xernerxUser.ts"],"names":[],"mappings":"AAAA,cAAc;AAGd,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,WAAW,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAE5H,wBAAsB,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,uBAAuB,GAAG,6BAA6B,GAAG,6BAA6B,EAAE,MAAM,EAAE,aAAa,wBAOvK"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
+
/** @format */
|
|
1
2
|
export async function xernerxUser(event, client) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
voted: client.util.hasVoted ? await client.util.hasVoted(author.id) : null,
|
|
7
|
-
};
|
|
8
|
-
return user;
|
|
3
|
+
const author = event.author || event.user;
|
|
4
|
+
author.owner = isOwner(client, author);
|
|
5
|
+
author.voted = client.util.hasVoted ? await client.util.hasVoted(author.id) : null;
|
|
6
|
+
return author;
|
|
9
7
|
}
|
|
10
8
|
function isOwner(client, user) {
|
|
11
|
-
|
|
9
|
+
return client.settings.ownerId.includes(user.id);
|
|
12
10
|
}
|
|
13
11
|
//# sourceMappingURL=xernerxUser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xernerxUser.js","sourceRoot":"","sources":["../../src/functions/xernerxUser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"xernerxUser.js","sourceRoot":"","sources":["../../src/functions/xernerxUser.ts"],"names":[],"mappings":"AAAA,cAAc;AAMd,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAA+G,EAAE,MAAqB;IACvK,MAAM,MAAM,GAAiC,KAAwB,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC;IAE1F,MAAsB,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,MAAc,CAAC,CAAC;IAC/D,MAAsB,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEpG,OAAO,MAAqB,CAAC;AAC9B,CAAC;AAED,SAAS,OAAO,CAAC,MAAqB,EAAE,IAAU;IACjD,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAClD,CAAC","sourcesContent":["/** @format */\n\nimport { User } from 'discord.js';\nimport XernerxClient from '../client/XernerxClient.js';\nimport { XernerxMessage, XernerxSlashInteraction, XernerxUser, XernerxUserContextInteraction } from '../types/extenders.js';\n\nexport async function xernerxUser(event: XernerxMessage | XernerxSlashInteraction | XernerxUserContextInteraction | XernerxUserContextInteraction, client: XernerxClient) {\n\tconst author: Partial<XernerxUser | User> = (event as XernerxMessage).author || event.user;\n\n\t(author as XernerxUser).owner = isOwner(client, author as User);\n\t(author as XernerxUser).voted = client.util.hasVoted ? await client.util.hasVoted(author.id) : null;\n\n\treturn author as XernerxUser;\n}\n\nfunction isOwner(client: XernerxClient, user: User) {\n\treturn client.settings.ownerId.includes(user.id);\n}\n"]}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
/** @format */
|
|
1
2
|
import XernerxClient from '../client/XernerxClient.js';
|
|
2
3
|
import { ContextHandlerOptions, MessageHandlerOptions, SlashHandlerOptions } from '../types/interfaces.js';
|
|
3
4
|
import Handler from './Handler.js';
|
|
4
5
|
export default class CommandHandler extends Handler {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
constructor(client: XernerxClient);
|
|
7
|
+
loadMessageCommands(options: MessageHandlerOptions): void;
|
|
8
|
+
loadSlashCommands(options: SlashHandlerOptions): void;
|
|
9
|
+
loadContextCommands(options: ContextHandlerOptions): void;
|
|
10
|
+
private messageCommandRun;
|
|
11
|
+
private slashCommandRun;
|
|
12
|
+
private contextCommandRun;
|
|
13
|
+
private exec;
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=CommandHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/CommandHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CommandHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/CommandHandler.ts"],"names":[],"mappings":"AAAA,cAAc;AAMd,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC3G,OAAO,OAAO,MAAM,cAAc,CAAC;AAenC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;gBACtC,MAAM,EAAE,aAAa;IAI1B,mBAAmB,CAAC,OAAO,EAAE,qBAAqB;IA2DlD,iBAAiB,CAAC,OAAO,EAAE,mBAAmB;IA2C9C,mBAAmB,CAAC,OAAO,EAAE,qBAAqB;YA4C3C,iBAAiB;YA6GjB,eAAe;YA+Bf,iBAAiB;YAoBjB,IAAI;CAoBlB"}
|