xernerx 4.5.22 → 4.5.26

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 (70) hide show
  1. package/README.md +3 -0
  2. package/dist/build/XernerxContextCommand.d.ts +42 -50
  3. package/dist/build/XernerxContextCommand.js +71 -71
  4. package/dist/build/XernerxEvent.d.ts +15 -15
  5. package/dist/build/XernerxEvent.js +22 -22
  6. package/dist/build/XernerxInhibitor.d.ts +14 -25
  7. package/dist/build/XernerxInhibitor.js +20 -20
  8. package/dist/build/XernerxMessageCommand.d.ts +47 -53
  9. package/dist/build/XernerxMessageCommand.js +70 -70
  10. package/dist/build/XernerxSlashCommand.d.ts +57 -71
  11. package/dist/build/XernerxSlashCommand.js +128 -128
  12. package/dist/client/XernerxClient.d.ts +40 -48
  13. package/dist/client/XernerxClient.js +77 -77
  14. package/dist/client/XernerxShardClient.d.ts +12 -12
  15. package/dist/client/XernerxShardClient.js +39 -47
  16. package/dist/functions/deploy.d.ts +1 -1
  17. package/dist/functions/deploy.js +36 -31
  18. package/dist/functions/load.d.ts +1 -1
  19. package/dist/functions/load.js +29 -28
  20. package/dist/functions/reload.d.ts +1 -1
  21. package/dist/functions/reload.js +38 -35
  22. package/dist/functions/sendWebhook.d.ts +1 -1
  23. package/dist/functions/sendWebhook.js +12 -11
  24. package/dist/functions/setPresence.d.ts +2 -2
  25. package/dist/functions/setPresence.js +17 -18
  26. package/dist/functions/xernerxUser.d.ts +1 -1
  27. package/dist/functions/xernerxUser.js +6 -6
  28. package/dist/handlers/CommandHandler.d.ts +9 -9
  29. package/dist/handlers/CommandHandler.d.ts.map +1 -1
  30. package/dist/handlers/CommandHandler.js +281 -249
  31. package/dist/handlers/CommandHandler.js.map +1 -1
  32. package/dist/handlers/EventHandler.d.ts +3 -3
  33. package/dist/handlers/EventHandler.js +19 -19
  34. package/dist/handlers/ExtensionHandler.d.ts +3 -3
  35. package/dist/handlers/ExtensionHandler.js +20 -18
  36. package/dist/handlers/Handler.d.ts +8 -8
  37. package/dist/handlers/Handler.js +42 -32
  38. package/dist/handlers/InhibitorHandler.d.ts +3 -3
  39. package/dist/handlers/InhibitorHandler.js +19 -19
  40. package/dist/handlers/WebhookHandler.d.ts +6 -4
  41. package/dist/handlers/WebhookHandler.js +44 -47
  42. package/dist/main.d.ts +22 -29
  43. package/dist/main.js +22 -29
  44. package/dist/models/Arguments.d.ts +2 -5
  45. package/dist/models/Arguments.js +150 -135
  46. package/dist/tools/XernerxError.d.ts +5 -5
  47. package/dist/tools/XernerxError.js +9 -9
  48. package/dist/tools/XernerxLog.d.ts +13 -13
  49. package/dist/tools/XernerxLog.js +69 -74
  50. package/dist/tools/XernerxText.d.ts +23 -23
  51. package/dist/tools/XernerxText.js +85 -76
  52. package/dist/types/extenders.d.ts +36 -44
  53. package/dist/types/extenders.js +1 -1
  54. package/dist/types/interfaces.d.ts +182 -185
  55. package/dist/types/interfaces.js +1 -1
  56. package/dist/types/types.d.ts +7 -179
  57. package/dist/types/types.js +1 -1
  58. package/dist/utils/ClientUtil.d.ts +9 -11
  59. package/dist/utils/ClientUtil.js +73 -57
  60. package/dist/utils/InteractionUtil.d.ts +7 -7
  61. package/dist/utils/InteractionUtil.js +98 -96
  62. package/dist/utils/MessageUtil.d.ts +11 -11
  63. package/dist/utils/MessageUtil.js +135 -130
  64. package/dist/utils/Util.d.ts +5 -5
  65. package/dist/utils/Util.js +8 -8
  66. package/dist/validators/commandValidation.d.ts +2 -5
  67. package/dist/validators/commandValidation.js +53 -43
  68. package/dist/validators/inhibitorValidations.d.ts +3 -19
  69. package/dist/validators/inhibitorValidations.js +31 -31
  70. package/package.json +16 -13
@@ -1,136 +1,141 @@
1
1
  /** @format */
2
- import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ChannelType, StringSelectMenuBuilder } from 'discord.js';
2
+ import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ChannelType, StringSelectMenuBuilder, } from 'discord.js';
3
3
  import Util from './Util.js';
4
4
  import sendWebhook from '../functions/sendWebhook.js';
5
5
  import XernerxError from '../tools/XernerxError.js';
6
6
  export default class MessageUtil extends Util {
7
- message;
8
- constructor(client, message) {
9
- super(client);
10
- this.message = message;
11
- this.parsed = {
12
- alias: null,
13
- prefix: null,
14
- };
15
- }
16
- async send(content) {
17
- if (this.client.cache.messages.has(this.message.id) && this.client.modules.options.message?.handleEdits) {
18
- const id = this.client.cache.messages.get(this.message.id);
19
- if (!id) return null;
20
- const msg = await this.message.channel.messages.fetch(id);
21
- msg.edit(content);
22
- return msg;
23
- }
24
- const msg = await this.message.channel.send(content);
25
- this.client.cache.messages.set(this.message.id, msg.id);
26
- return msg;
27
- }
28
- async reply(content) {
29
- if (this.client.cache.messages.has(this.message.id) && this.client.modules.options.message?.handleEdits) {
30
- const id = this.client.cache.messages.get(this.message.id);
31
- if (!id) return null;
32
- const msg = await this.message.channel.messages.fetch(id);
33
- msg.edit(content);
34
- return msg;
35
- }
36
- const msg = await this.message.reply(content);
37
- this.client.cache.messages.set(this.message.id, msg.id);
38
- return msg;
39
- }
40
- async webhookReply(content, url, user) {
41
- if (this.message.channel.type === ChannelType.DM) throw new XernerxError(`Can't use this method in DM Channels`);
42
- const channel = this.message.channel;
43
- let webhook;
44
- if (!url) {
45
- webhook = await channel.createWebhook({
46
- name: user?.username || this.client.user?.username,
47
- avatar: user?.avatarURL() || this.client.user?.avatarURL(),
48
- });
49
- }
50
- if (!webhook) webhook = { url };
51
- await sendWebhook(webhook.url, content);
52
- if (!url) webhook.delete();
53
- return;
54
- }
55
- async paginator(embeds, options = {}) {
56
- let buttonRow, menuRow;
57
- if (embeds.length <= 0) throw new XernerxError(`Can't make a paginator without embeds`);
58
- options = {
59
- type: options.type ?? 'combined',
60
- buttons: options.buttons ?? ['⏪', '◀️', '⏹️', '▶️', '⏩'],
61
- description: options.description ?? false,
62
- placeholder: options.placeholder ?? 'Change page',
63
- index: options.index ?? 0,
64
- send: options.send ?? false,
65
- filter: options.filter ?? (() => true),
66
- time: options.time ?? 300000,
67
- };
68
- if (options.type == 'button' || options.type == 'combined') {
69
- if (!options.buttons) throw new XernerxError(`¯\\_(ツ)_/¯ Somehow there are no buttons? ¯\\_(ツ)_/¯`);
70
- buttonRow = new ActionRowBuilder().addComponents(
71
- ...options.buttons.map((button, i) => new ButtonBuilder().setCustomId(`${this.message.id}-${i}`).setEmoji(button).setStyle(ButtonStyle.Primary))
72
- );
73
- }
74
- if (options.type == 'select-menu' || options.type == 'combined') {
75
- menuRow = new ActionRowBuilder().addComponents(
76
- new StringSelectMenuBuilder()
77
- .setCustomId(`${this.message.id}-select-menu`)
78
- .setPlaceholder(options.placeholder)
79
- .addOptions(...embeds.map((embed, i) => ({ label: embed.data.title || 'No Title', description: (options.description ? embed.data.description : undefined) || undefined, value: `${i}` })))
80
- );
81
- }
82
- let index = options.index || 0;
83
- return options.send
84
- ? await this.message.util.send({
85
- embeds: [embeds[index]],
86
- components: [options.type == 'combined' || options.type == 'button' ? buttonRow : null, options.type == 'combined' || options.type == 'select-menu' ? menuRow : null].filter((x) => x),
87
- })
88
- : await this.message.util
89
- .reply({
90
- embeds: [embeds[index]],
91
- components: [options.type == 'combined' || options.type == 'button' ? buttonRow : null, options.type == 'combined' || options.type == 'select-menu' ? menuRow : null].filter((x) => x),
92
- })
93
- .then(async (msg) => {
94
- const collector = this.message.channel
95
- ?.createMessageComponentCollector({ time: options.time })
96
- .on('collect', (collect) => {
97
- if (!collect.customId.startsWith(this.message.id)) return;
98
- if (collect.customId.endsWith('select-menu')) {
99
- index = Number(collect.values[0]);
100
- collect.update({ embeds: [embeds[index]] });
101
- } else {
102
- const option = Number(collect.customId.split(/-/)[1]);
103
- let embed = embeds[index];
104
- if (option == 0) {
105
- index = 0;
106
- embed = embeds[index];
107
- collect.update({ embeds: [embed] });
108
- }
109
- if (option == 1) {
110
- index = embeds.indexOf(embed) >= 1 ? embeds.indexOf(embed) - 1 : 0;
111
- embed = embeds[index];
112
- collect.update({ embeds: [embed] });
113
- }
114
- if (option == 2) {
115
- collect.update({ components: [] });
116
- collector?.stop();
117
- }
118
- if (option == 3) {
119
- index = embeds.indexOf(embed) < embeds.length - 1 ? embeds.indexOf(embed) + 1 : embeds.length - 1;
120
- embed = embeds[index];
121
- collect.update({ embeds: [embed] });
122
- }
123
- if (option == 4) {
124
- index = embeds.length - 1;
125
- embed = embeds[index];
126
- collect.update({ embeds: [embed] });
127
- }
128
- }
129
- })
130
- .on('end', async () => {
131
- await msg?.edit({ components: [] });
132
- });
133
- });
134
- }
7
+ message;
8
+ constructor(client, message) {
9
+ super(client);
10
+ this.message = message;
11
+ this.parsed = {
12
+ alias: null,
13
+ prefix: null,
14
+ };
15
+ }
16
+ async send(content) {
17
+ if (this.client.cache.messages.has(this.message.id) && this.client.modules.options.message?.handleEdits) {
18
+ const id = this.client.cache.messages.get(this.message.id);
19
+ if (!id)
20
+ return null;
21
+ const msg = await this.message.channel.messages.fetch(id);
22
+ msg.edit(content);
23
+ return msg;
24
+ }
25
+ const msg = await this.message.channel.send(content);
26
+ this.client.cache.messages.set(this.message.id, msg.id);
27
+ return msg;
28
+ }
29
+ async reply(content) {
30
+ if (this.client.cache.messages.has(this.message.id) && this.client.modules.options.message?.handleEdits) {
31
+ const id = this.client.cache.messages.get(this.message.id);
32
+ if (!id)
33
+ return null;
34
+ const msg = await this.message.channel.messages.fetch(id);
35
+ msg.edit(content);
36
+ return msg;
37
+ }
38
+ const msg = await this.message.reply(content);
39
+ this.client.cache.messages.set(this.message.id, msg.id);
40
+ return msg;
41
+ }
42
+ async webhookReply(content, url, user) {
43
+ if (this.message.channel.type === ChannelType.DM)
44
+ throw new XernerxError(`Can't use this method in DM Channels`);
45
+ const channel = this.message.channel;
46
+ let webhook;
47
+ if (!url) {
48
+ webhook = await channel.createWebhook({
49
+ name: user?.username || this.client.user?.username,
50
+ avatar: user?.avatarURL() || this.client.user?.avatarURL(),
51
+ });
52
+ }
53
+ if (!webhook)
54
+ webhook = { url };
55
+ await sendWebhook(webhook.url, content);
56
+ if (!url)
57
+ webhook.delete();
58
+ return;
59
+ }
60
+ async paginator(embeds, options = {}) {
61
+ let buttonRow, menuRow;
62
+ if (embeds.length <= 0)
63
+ throw new XernerxError(`Can't make a paginator without embeds`);
64
+ options = {
65
+ type: options.type ?? 'combined',
66
+ buttons: options.buttons ?? ['⏪', '◀️', '⏹️', '▶️', '⏩'],
67
+ description: options.description ?? false,
68
+ placeholder: options.placeholder ?? 'Change page',
69
+ index: options.index ?? 0,
70
+ send: options.send ?? false,
71
+ filter: options.filter ?? (() => true),
72
+ time: options.time ?? 300000,
73
+ };
74
+ if (options.type == 'button' || options.type == 'combined') {
75
+ if (!options.buttons)
76
+ throw new XernerxError(`¯\\_(ツ)_/¯ Somehow there are no buttons? ¯\\_(ツ)_/¯`);
77
+ buttonRow = new ActionRowBuilder().addComponents(...options.buttons.map((button, i) => new ButtonBuilder().setCustomId(`${this.message.id}-${i}`).setEmoji(button).setStyle(ButtonStyle.Primary)));
78
+ }
79
+ if (options.type == 'select-menu' || options.type == 'combined') {
80
+ menuRow = new ActionRowBuilder().addComponents(new StringSelectMenuBuilder()
81
+ .setCustomId(`${this.message.id}-select-menu`)
82
+ .setPlaceholder(options.placeholder)
83
+ .addOptions(...embeds.map((embed, i) => ({ label: embed.data.title || 'No Title', description: (options.description ? embed.data.description : undefined) || undefined, value: `${i}` }))));
84
+ }
85
+ let index = options.index || 0;
86
+ return options.send
87
+ ? await this.message.util.send({
88
+ embeds: [embeds[index]],
89
+ components: [options.type == 'combined' || options.type == 'button' ? buttonRow : null, options.type == 'combined' || options.type == 'select-menu' ? menuRow : null].filter((x) => x),
90
+ })
91
+ : await this.message.util
92
+ .reply({
93
+ embeds: [embeds[index]],
94
+ components: [options.type == 'combined' || options.type == 'button' ? buttonRow : null, options.type == 'combined' || options.type == 'select-menu' ? menuRow : null].filter((x) => x),
95
+ })
96
+ .then(async (msg) => {
97
+ const collector = this.message.channel
98
+ ?.createMessageComponentCollector({ time: options.time })
99
+ .on('collect', (collect) => {
100
+ if (!collect.customId.startsWith(this.message.id))
101
+ return;
102
+ if (collect.customId.endsWith('select-menu')) {
103
+ index = Number(collect.values[0]);
104
+ collect.update({ embeds: [embeds[index]] });
105
+ }
106
+ else {
107
+ const option = Number(collect.customId.split(/-/)[1]);
108
+ let embed = embeds[index];
109
+ if (option == 0) {
110
+ index = 0;
111
+ embed = embeds[index];
112
+ collect.update({ embeds: [embed] });
113
+ }
114
+ if (option == 1) {
115
+ index = embeds.indexOf(embed) >= 1 ? embeds.indexOf(embed) - 1 : 0;
116
+ embed = embeds[index];
117
+ collect.update({ embeds: [embed] });
118
+ }
119
+ if (option == 2) {
120
+ collect.update({ components: [] });
121
+ collector?.stop();
122
+ }
123
+ if (option == 3) {
124
+ index = embeds.indexOf(embed) < embeds.length - 1 ? embeds.indexOf(embed) + 1 : embeds.length - 1;
125
+ embed = embeds[index];
126
+ collect.update({ embeds: [embed] });
127
+ }
128
+ if (option == 4) {
129
+ index = embeds.length - 1;
130
+ embed = embeds[index];
131
+ collect.update({ embeds: [embed] });
132
+ }
133
+ }
134
+ })
135
+ .on('end', async () => {
136
+ await msg?.edit({ components: [] });
137
+ });
138
+ });
139
+ }
135
140
  }
136
- //# sourceMappingURL=MessageUtil.js.map
141
+ //# sourceMappingURL=MessageUtil.js.map
@@ -2,9 +2,9 @@
2
2
  import XernerxClient from '../client/XernerxClient.js';
3
3
  import XernerxText from '../tools/XernerxText.js';
4
4
  export default class Util {
5
- readonly client: XernerxClient<unknown>;
6
- readonly text: XernerxText;
7
- constructor(client: XernerxClient);
8
- delay(time: number): Promise<unknown>;
5
+ readonly client: XernerxClient<unknown>;
6
+ readonly text: XernerxText;
7
+ constructor(client: XernerxClient);
8
+ delay(time: number): Promise<unknown>;
9
9
  }
10
- //# sourceMappingURL=Util.d.ts.map
10
+ //# sourceMappingURL=Util.d.ts.map
@@ -1,12 +1,12 @@
1
1
  /** @format */
2
2
  import XernerxText from '../tools/XernerxText.js';
3
3
  export default class Util {
4
- constructor(client) {
5
- this.client = client;
6
- this.text = new XernerxText();
7
- }
8
- async delay(time) {
9
- return await new Promise((resolve) => setTimeout(resolve, time));
10
- }
4
+ constructor(client) {
5
+ this.client = client;
6
+ this.text = new XernerxText();
7
+ }
8
+ async delay(time) {
9
+ return await new Promise((resolve) => setTimeout(resolve, time));
10
+ }
11
11
  }
12
- //# sourceMappingURL=Util.js.map
12
+ //# sourceMappingURL=Util.js.map
@@ -4,8 +4,5 @@ import MessageCommandBuilder from '../build/XernerxMessageCommand.js';
4
4
  import XernerxSlashCommand from '../build/XernerxSlashCommand.js';
5
5
  import { XernerxMessage, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';
6
6
  import { XernerxInteraction } from '../types/types.js';
7
- export default function commandValidation(
8
- event: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxUserContextInteraction> | XernerxMessage,
9
- command: MessageCommandBuilder | XernerxSlashCommand | XernerxContextCommand
10
- ): Promise<boolean>;
11
- //# sourceMappingURL=commandValidation.d.ts.map
7
+ export default function commandValidation(event: XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxUserContextInteraction> | XernerxMessage, command: MessageCommandBuilder | XernerxSlashCommand | XernerxContextCommand): Promise<boolean>;
8
+ //# sourceMappingURL=commandValidation.d.ts.map
@@ -1,51 +1,61 @@
1
1
  /** @format */
2
2
  import { ChannelType, PermissionFlagsBits } from 'discord.js';
3
3
  export default async function commandValidation(event, command) {
4
- const client = event.client;
5
- if (command.ignore?.owner && client.settings.ownerId.includes(event.user.id)) return false;
6
- if (!client.cache.cooldowns.has(`${event.user.id}-${command.name}`)) {
7
- client.cache.cooldowns.set(`${event.user.id}-${command.name}`, {
8
- id: event.user.id,
9
- command: command.name,
10
- createdTimestamp: Number(Date.now()) + (command.cooldown || 0),
11
- });
12
- setTimeout(() => {
13
- client.cache.cooldowns.delete(`${event.user.id}-${command.name}`);
14
- }, command.cooldown || 0);
15
- } else {
16
- const user = client.cache.cooldowns.get(`${event.user.id}-${command.name}`);
17
- const time = (user?.createdTimestamp || 0) - Number(Date.now());
18
- return emit(event, `Command on cooldown, ${time}`);
19
- }
20
- if ((command.ignore?.channels?.length || 0) > 0 && command.ignore?.channels?.includes(event.channel?.id)) return true;
21
- if ((command.ignore?.guilds?.length || 0) > 0 && command.ignore?.guilds?.includes(event.guild?.id)) return true;
22
- if ((command.ignore?.users?.length || 0) > 0 && command.ignore?.users?.includes(event.user.id)) return true;
23
- if (command.strict?.owner && !client.settings.ownerId.includes(event.user.id)) return await emit(event, 'Command is a developer command');
24
- if ((command.strict?.channels?.length || 0) > 0 && !command.strict?.channels?.includes(event.channel?.id)) return await emit(event, 'Command cannot be ran in this channel');
25
- if ((command.strict?.guilds?.length || 0) > 0 && !command.strict?.guilds?.includes(event.guild?.id)) return await emit(event, 'Command cannot be ran in this guild');
26
- if ((command.strict?.users?.length || 0) > 0 && !command.strict?.users?.includes(event.user.id)) return await emit(event, 'Command cannot be ran by you');
27
- if (command.permissions?.dm == false && event.channel?.type === ChannelType.DM) return await emit(event, "Can't use in a DM Channel");
28
- if (command.permissions?.user) {
29
- if (!(event.member?.permissions).has(toBigInt(command.permissions.user))) return await emit(event, 'Missing User Permissions');
30
- }
31
- return false;
4
+ const client = event.client;
5
+ if (command.ignore?.owner && client.settings.ownerId.includes(event.user.id))
6
+ return false;
7
+ if (!client.cache.cooldowns.has(`${event.user.id}-${command.name}`)) {
8
+ client.cache.cooldowns.set(`${event.user.id}-${command.name}`, {
9
+ id: event.user.id,
10
+ command: command.name,
11
+ createdTimestamp: Number(Date.now()) + (command.cooldown || 0),
12
+ });
13
+ setTimeout(() => {
14
+ client.cache.cooldowns.delete(`${event.user.id}-${command.name}`);
15
+ }, command.cooldown || 0);
16
+ }
17
+ else {
18
+ const user = client.cache.cooldowns.get(`${event.user.id}-${command.name}`);
19
+ const time = (user?.createdTimestamp || 0) - Number(Date.now());
20
+ return emit(event, `Command on cooldown, ${time}`);
21
+ }
22
+ if ((command.ignore?.channels?.length || 0) > 0 && command.ignore?.channels?.includes(event.channel?.id))
23
+ return true;
24
+ if ((command.ignore?.guilds?.length || 0) > 0 && command.ignore?.guilds?.includes(event.guild?.id))
25
+ return true;
26
+ if ((command.ignore?.users?.length || 0) > 0 && command.ignore?.users?.includes(event.user.id))
27
+ return true;
28
+ if (command.strict?.owner && !client.settings.ownerId.includes(event.user.id))
29
+ return await emit(event, 'Command is a developer command');
30
+ if ((command.strict?.channels?.length || 0) > 0 && !command.strict?.channels?.includes(event.channel?.id))
31
+ return await emit(event, 'Command cannot be ran in this channel');
32
+ if ((command.strict?.guilds?.length || 0) > 0 && !command.strict?.guilds?.includes(event.guild?.id))
33
+ return await emit(event, 'Command cannot be ran in this guild');
34
+ if ((command.strict?.users?.length || 0) > 0 && !command.strict?.users?.includes(event.user.id))
35
+ return await emit(event, 'Command cannot be ran by you');
36
+ if (command.permissions?.dm == false && event.channel?.type === ChannelType.DM)
37
+ return await emit(event, "Can't use in a DM Channel");
38
+ if (command.permissions?.user) {
39
+ if (!(event.member?.permissions).has(toBigInt(command.permissions.user)))
40
+ return await emit(event, 'Missing User Permissions');
41
+ }
42
+ return false;
32
43
  }
33
44
  async function emit(event, reason) {
34
- event.client.emit('commandBlock', event, reason);
35
- return true;
45
+ event.client.emit('commandBlock', event, reason);
46
+ return true;
36
47
  }
37
48
  function toBigInt(permissions) {
38
- let bigIntPermissions = 0n;
39
- permissions.map((permission) => {
40
- permission =
41
- PermissionFlagsBits[
42
- permission
43
- .split(/ +/)
44
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
45
- .join('')
46
- ];
47
- if (typeof permission === 'bigint') bigIntPermissions += permission;
48
- });
49
- return bigIntPermissions;
49
+ let bigIntPermissions = 0n;
50
+ permissions.map((permission) => {
51
+ permission =
52
+ PermissionFlagsBits[permission
53
+ .split(/ +/)
54
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
55
+ .join('')];
56
+ if (typeof permission === 'bigint')
57
+ bigIntPermissions += permission;
58
+ });
59
+ return bigIntPermissions;
50
60
  }
51
- //# sourceMappingURL=commandValidation.js.map
61
+ //# sourceMappingURL=commandValidation.js.map
@@ -2,22 +2,6 @@
2
2
  import { XernerxContextCommand, XernerxMessageCommand, XernerxSlashCommand } from '../main.js';
3
3
  import { XernerxMessage, XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';
4
4
  import { InhibitorType, XernerxInteraction } from '../types/types.js';
5
- export declare function inhibitorValidation(
6
- event: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,
7
- cmd?: XernerxContextCommand | XernerxMessageCommand | XernerxSlashCommand
8
- ): Promise<boolean>;
9
- export declare function inhibitorArguments(
10
- event: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,
11
- cmd: XernerxContextCommand | XernerxMessageCommand | XernerxSlashCommand | null,
12
- type: InhibitorType
13
- ):
14
- | import('../main.js').XernerxUser
15
- | import('discord.js').GuildMember
16
- | import('discord.js').Guild
17
- | import('discord.js').TextBasedChannel
18
- | XernerxMessageCommand
19
- | XernerxSlashCommand
20
- | XernerxContextCommand
21
- | import('../main.js').APIInteractionGuildMember
22
- | null;
23
- //# sourceMappingURL=inhibitorValidations.d.ts.map
5
+ export declare function inhibitorValidation(event: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>, cmd?: XernerxContextCommand | XernerxMessageCommand | XernerxSlashCommand): Promise<boolean>;
6
+ export declare function inhibitorArguments(event: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>, cmd: XernerxContextCommand | XernerxMessageCommand | XernerxSlashCommand | null, type: InhibitorType): import("../main.js").XernerxUser | import("discord.js").GuildMember | import("discord.js").Guild | import("discord.js").TextBasedChannel | XernerxMessageCommand | XernerxSlashCommand | XernerxContextCommand | import("../main.js").APIInteractionGuildMember | null;
7
+ //# sourceMappingURL=inhibitorValidations.d.ts.map
@@ -1,36 +1,36 @@
1
1
  /** @format */
2
2
  export async function inhibitorValidation(event, cmd) {
3
- const client = event.client;
4
- const inhibits = [];
5
- for (const [name, inhibitor] of client.inhibitors) {
6
- if (Boolean(await inhibitor.check(event, await inhibitorArguments(event, cmd || null, inhibitor.type)))) {
7
- inhibits.push(name);
8
- }
9
- }
10
- return !!inhibits.length;
3
+ const client = event.client;
4
+ const inhibits = [];
5
+ for (const [name, inhibitor] of client.inhibitors) {
6
+ if (Boolean(await inhibitor.check(event, (await inhibitorArguments(event, cmd || null, inhibitor.type))))) {
7
+ inhibits.push(name);
8
+ }
9
+ }
10
+ return !!inhibits.length;
11
11
  }
12
12
  export function inhibitorArguments(event, cmd, type) {
13
- switch (type) {
14
- case 'channel':
15
- return event.channel || null;
16
- case 'command':
17
- return cmd;
18
- case 'contextCommand':
19
- return cmd;
20
- case 'guild':
21
- return event.guild || null;
22
- case 'interaction':
23
- return null;
24
- case 'member':
25
- return event.member || null;
26
- case 'message':
27
- return null;
28
- case 'messageCommand':
29
- return cmd;
30
- case 'slashCommand':
31
- return cmd;
32
- case 'user':
33
- return event.user;
34
- }
13
+ switch (type) {
14
+ case 'channel':
15
+ return event.channel || null;
16
+ case 'command':
17
+ return cmd;
18
+ case 'contextCommand':
19
+ return cmd;
20
+ case 'guild':
21
+ return event.guild || null;
22
+ case 'interaction':
23
+ return null;
24
+ case 'member':
25
+ return event.member || null;
26
+ case 'message':
27
+ return null;
28
+ case 'messageCommand':
29
+ return cmd;
30
+ case 'slashCommand':
31
+ return cmd;
32
+ case 'user':
33
+ return event.user;
34
+ }
35
35
  }
36
- //# sourceMappingURL=inhibitorValidations.js.map
36
+ //# sourceMappingURL=inhibitorValidations.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xernerx",
3
- "version": "4.5.22",
3
+ "version": "4.5.26",
4
4
  "description": "A bot framework for discord.js.",
5
5
  "main": "dist/main.js",
6
6
  "type": "module",
@@ -17,15 +17,18 @@
17
17
  "license": "MIT",
18
18
  "homepage": "https://xernerx.github.io/xernerx",
19
19
  "packageManager": "npm@8.5.5",
20
+ "engines": {
21
+ "node": "20.3.0"
22
+ },
20
23
  "scripts": {
21
24
  "start": "npm i && npm fund && npm audit fix --force && npm link && tsc -w",
22
25
  "commit": "npm run write && git add . && node ./.github/scripts/message.js",
23
26
  "tag": "node ./.github/scripts/tag.js",
24
- "patch": "npm run commit && npm version patch && npm run tag && npm publish && git push",
25
- "minor": "npm run commit && npm version minor && npm run tag && npm publish && git push",
26
- "major": "npm run commit && npm version major && npm run tag && npm publish && git push",
27
+ "patch": "npm run commit && npm version patch && npm run tag && git push",
28
+ "minor": "npm run commit && npm version minor && npm run tag && git push",
29
+ "major": "npm run commit && npm version major && npm run tag && git push",
27
30
  "site": "git add docs && npm run commit && git push",
28
- "write": "npm run build && npm run format",
31
+ "write": "npm i && npm run build && npm run format",
29
32
  "format": "npx prettier --write src dist",
30
33
  "build": "tsc && npm run format"
31
34
  },
@@ -37,15 +40,15 @@
37
40
  "url": "https://github.com/xernerx/xernerx/issues"
38
41
  },
39
42
  "dependencies": {
40
- "dbl-sdk": "^1.2.0",
41
- "discord.js": "^14.11.0",
42
- "dumfunctions": "^2.1.2",
43
- "readline": "^1.3.0",
44
- "xernerx-extension-builder": "^0.0.16",
45
- "zod": "^3.21.4"
43
+ "dbl-sdk": "1.2.0",
44
+ "discord.js": "14.11.0",
45
+ "dumfunctions": "2.1.2",
46
+ "xernerx-extension-builder": "0.0.16",
47
+ "zod": "3.21.4"
46
48
  },
47
49
  "devDependencies": {
48
- "prettier": "^2.8.7",
49
- "typescript": "^5.0.3"
50
+ "prettier": "3.0.0",
51
+ "readline": "1.3.0",
52
+ "typescript": "5.1.6"
50
53
  }
51
54
  }