xernerx 4.4.13 → 4.4.14

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 (73) hide show
  1. package/dist/build/ContextCommandBuilder.d.ts +31 -23
  2. package/dist/build/ContextCommandBuilder.js +39 -39
  3. package/dist/build/EventBuilder.d.ts +1 -1
  4. package/dist/build/EventBuilder.js +2 -2
  5. package/dist/build/InhibitorBuilder.d.ts +1 -1
  6. package/dist/build/InhibitorBuilder.js +2 -2
  7. package/dist/build/MessageCommandBuilder.d.ts +26 -20
  8. package/dist/build/MessageCommandBuilder.js +34 -34
  9. package/dist/build/SlashCommandBuilder.d.ts +31 -23
  10. package/dist/build/SlashCommandBuilder.js +48 -48
  11. package/dist/client/XernerxClient.d.ts +30 -22
  12. package/dist/client/XernerxClient.js +33 -33
  13. package/dist/client/XernerxShardClient.d.ts +1 -1
  14. package/dist/client/XernerxShardClient.d.ts.map +1 -1
  15. package/dist/client/XernerxShardClient.js +18 -12
  16. package/dist/client/XernerxShardClient.js.map +1 -1
  17. package/dist/functions/delay.d.ts +1 -1
  18. package/dist/functions/delay.js +1 -1
  19. package/dist/functions/deploy.d.ts +1 -1
  20. package/dist/functions/deploy.js +13 -16
  21. package/dist/functions/isOwner.d.ts +1 -1
  22. package/dist/functions/isOwner.js +1 -1
  23. package/dist/functions/isVoter.d.ts +1 -1
  24. package/dist/functions/isVoter.js +1 -1
  25. package/dist/functions/load.d.ts +1 -1
  26. package/dist/functions/load.js +2 -3
  27. package/dist/functions/reload.d.ts +1 -1
  28. package/dist/functions/reload.js +9 -12
  29. package/dist/functions/sendWebhook.d.ts +1 -1
  30. package/dist/functions/sendWebhook.js +2 -3
  31. package/dist/functions/setPresence.d.ts +2 -2
  32. package/dist/functions/setPresence.js +12 -11
  33. package/dist/functions/xernerxUser.d.ts +1 -1
  34. package/dist/functions/xernerxUser.js +1 -1
  35. package/dist/handlers/CommandHandler.d.ts +1 -1
  36. package/dist/handlers/CommandHandler.js +82 -105
  37. package/dist/handlers/EventHandler.d.ts +1 -1
  38. package/dist/handlers/EventHandler.js +3 -3
  39. package/dist/handlers/ExtensionHandler.d.ts +1 -1
  40. package/dist/handlers/ExtensionHandler.js +3 -5
  41. package/dist/handlers/Handler.d.ts +1 -1
  42. package/dist/handlers/Handler.js +6 -16
  43. package/dist/handlers/InhibitorHandler.d.ts +1 -1
  44. package/dist/handlers/InhibitorHandler.js +3 -3
  45. package/dist/handlers/WebhookHandler.d.ts +2 -4
  46. package/dist/handlers/WebhookHandler.js +9 -6
  47. package/dist/main.d.ts +29 -22
  48. package/dist/main.js +29 -22
  49. package/dist/models/Arguments.d.ts +1 -1
  50. package/dist/models/Arguments.js +48 -63
  51. package/dist/tools/XernerxError.d.ts +1 -1
  52. package/dist/tools/XernerxError.js +1 -1
  53. package/dist/tools/XernerxLog.d.ts +1 -1
  54. package/dist/tools/XernerxLog.js +7 -2
  55. package/dist/types/extenders.d.ts +5 -9
  56. package/dist/types/extenders.js +1 -1
  57. package/dist/types/interfaces.d.ts +9 -6
  58. package/dist/types/interfaces.js +1 -1
  59. package/dist/types/types.d.ts +174 -6
  60. package/dist/types/types.js +1 -1
  61. package/dist/utils/ClientUtil.d.ts +4 -4
  62. package/dist/utils/ClientUtil.js +8 -14
  63. package/dist/utils/InteractionUtil.d.ts +2 -2
  64. package/dist/utils/InteractionUtil.js +1 -1
  65. package/dist/utils/MessageUtil.d.ts +2 -2
  66. package/dist/utils/MessageUtil.js +5 -9
  67. package/dist/utils/Util.d.ts +1 -1
  68. package/dist/utils/Util.js +1 -1
  69. package/dist/validators/commandValidation.d.ts +1 -1
  70. package/dist/validators/commandValidation.js +19 -29
  71. package/dist/validators/inhibitorValidations.d.ts +15 -2
  72. package/dist/validators/inhibitorValidations.js +1 -1
  73. package/package.json +1 -1
@@ -1,45 +1,35 @@
1
1
  export async function messageArguments(message, command) {
2
- const separator = command.separator || ' ', content = message.content.split(separator).slice(1);
3
- let args = {}, flags = {};
2
+ const separator = command.separator || ' ',
3
+ content = message.content.split(separator).slice(1);
4
+ let args = {},
5
+ flags = {};
4
6
  if (command.flags)
5
7
  command.flags.map((flag) => {
6
- if (!flags)
7
- flags = {};
8
- if (content.includes(flag.match))
9
- flags[flag.name] = true;
10
- else
11
- flags[flag.name] = false;
8
+ if (!flags) flags = {};
9
+ if (content.includes(flag.match)) flags[flag.name] = true;
10
+ else flags[flag.name] = false;
12
11
  const index = content.indexOf(flag.match);
13
- if (index > 0)
14
- content.splice(index, 1);
12
+ if (index > 0) content.splice(index, 1);
15
13
  });
16
14
  if (command.args)
17
15
  for (const argument of command.args) {
18
16
  const element = content.at(0) || null;
19
17
  if (!element) {
20
- if (typeof argument.default === 'function')
21
- args[argument.name] = argument.default(message);
18
+ if (typeof argument.default === 'function') args[argument.name] = argument.default(message);
22
19
  args[argument.name] = argument.default || null;
23
20
  continue;
24
21
  }
25
- if (argument.type === 'option')
26
- argument.match?.includes(element) ? (args[argument.name] = element) : (args[argument.name] = null);
27
- if (argument.type === 'number')
28
- args[argument.name] = parseInt(element);
29
- if (argument.type === 'integer')
30
- args[argument.name] = parseInt(element);
31
- if (argument.type === 'boolean')
32
- args[argument.name] = element === 'true' ? true : false;
33
- if (argument.type === 'confirm')
34
- args[argument.name] = element === 'yes' ? 'yes' : 'no';
35
- if (argument.type === 'string')
36
- args[argument.name] = element;
22
+ if (argument.type === 'option') argument.match?.includes(element) ? (args[argument.name] = element) : (args[argument.name] = null);
23
+ if (argument.type === 'number') args[argument.name] = parseInt(element);
24
+ if (argument.type === 'integer') args[argument.name] = parseInt(element);
25
+ if (argument.type === 'boolean') args[argument.name] = element === 'true' ? true : false;
26
+ if (argument.type === 'confirm') args[argument.name] = element === 'yes' ? 'yes' : 'no';
27
+ if (argument.type === 'string') args[argument.name] = element;
37
28
  if (argument.type === 'channel') {
38
29
  try {
39
30
  const channel = await message.client.channels.fetch(element);
40
31
  args[argument.name] = channel;
41
- }
42
- catch (e) {
32
+ } catch (e) {
43
33
  args[argument.name] = null;
44
34
  }
45
35
  }
@@ -47,32 +37,33 @@ export async function messageArguments(message, command) {
47
37
  try {
48
38
  const guild = await message.client.guilds.fetch(element);
49
39
  args[argument.name] = guild;
50
- }
51
- catch (e) {
40
+ } catch (e) {
52
41
  args[argument.name] = null;
53
42
  }
54
43
  }
55
44
  if (argument.type === 'mentionable') {
56
- (await Promise.all([message.guild?.roles, message.client.users, message.client.guilds, message.client.channels, message.guild?.members, message.channel.messages].map((req) => req
57
- ? req
58
- .fetch(element)
59
- .then((r) => r)
60
- .catch(() => null)
61
- : null))).map((mentionable) => {
62
- if (!args)
63
- args = {};
64
- if (mentionable)
65
- return (args[argument.name] = mentionable);
66
- else
67
- return (args[argument.name] = null);
45
+ (
46
+ await Promise.all(
47
+ [message.guild?.roles, message.client.users, message.client.guilds, message.client.channels, message.guild?.members, message.channel.messages].map((req) =>
48
+ req
49
+ ? req
50
+ .fetch(element)
51
+ .then((r) => r)
52
+ .catch(() => null)
53
+ : null
54
+ )
55
+ )
56
+ ).map((mentionable) => {
57
+ if (!args) args = {};
58
+ if (mentionable) return (args[argument.name] = mentionable);
59
+ else return (args[argument.name] = null);
68
60
  });
69
61
  }
70
62
  if (argument.type === 'role') {
71
63
  try {
72
64
  const role = await message.guild?.roles.fetch(element);
73
65
  args[argument.name] = role;
74
- }
75
- catch (e) {
66
+ } catch (e) {
76
67
  args[argument.name] = null;
77
68
  }
78
69
  }
@@ -80,8 +71,7 @@ export async function messageArguments(message, command) {
80
71
  try {
81
72
  const user = await message.client.users.fetch(element);
82
73
  args[argument.name] = user;
83
- }
84
- catch (e) {
74
+ } catch (e) {
85
75
  args[argument.name] = null;
86
76
  }
87
77
  }
@@ -89,8 +79,7 @@ export async function messageArguments(message, command) {
89
79
  try {
90
80
  const member = await message.guild?.members.fetch(element);
91
81
  args[argument.name] = member;
92
- }
93
- catch (e) {
82
+ } catch (e) {
94
83
  args[argument.name] = null;
95
84
  }
96
85
  }
@@ -98,20 +87,18 @@ export async function messageArguments(message, command) {
98
87
  try {
99
88
  const msg = await message.channel?.messages.fetch(element);
100
89
  args[argument.name] = msg;
101
- }
102
- catch (e) {
90
+ } catch (e) {
103
91
  args[argument.name] = null;
104
92
  }
105
93
  }
106
94
  if (argument.type === 'list') {
107
95
  let separator = String(argument.separator) || ',';
108
- if (separator.startsWith('/') && separator.endsWith('/'))
109
- separator = separator.replace(/^\/|\/$/gim, '');
96
+ if (separator.startsWith('/') && separator.endsWith('/')) separator = separator.replace(/^\/|\/$/gim, '');
110
97
  const items = content.join(' ').split(new RegExp(' *' + separator + ' *', 'gi'));
111
- if (!argument.content)
112
- args[argument.name] = items;
98
+ if (!argument.content) args[argument.name] = items;
113
99
  else {
114
- const contents = argument.content.map((content) => content.toLowerCase()), itemList = [];
100
+ const contents = argument.content.map((content) => content.toLowerCase()),
101
+ itemList = [];
115
102
  items.map((item) => (contents.includes(item.toLowerCase()) ? itemList.push(argument.content?.at(contents.indexOf(item.toLowerCase()))) : null));
116
103
  args[argument.name] = itemList;
117
104
  break;
@@ -123,16 +110,16 @@ export async function messageArguments(message, command) {
123
110
  }
124
111
  content.splice(0, 1);
125
112
  }
126
- if (!command.flags)
127
- flags = null;
128
- if (!command.args)
129
- args = null;
113
+ if (!command.flags) flags = null;
114
+ if (!command.args) args = null;
130
115
  return { args, flags };
131
116
  }
132
117
  export async function interactionArguments(interaction, command) {
133
118
  if (command.fileType === 'SlashCommand') {
134
119
  const options = {};
135
- let args = interaction?.options?._hoistedOptions, group = interaction?.options?._group, subcommand = interaction?.options?._subcommand;
120
+ let args = interaction?.options?._hoistedOptions,
121
+ group = interaction?.options?._group,
122
+ subcommand = interaction?.options?._subcommand;
136
123
  if (interaction.options._hoistedOptions) {
137
124
  for (const option of interaction.options._hoistedOptions) {
138
125
  options[option.name] = option.member || option.channel || option.user || option.role || option.value;
@@ -142,10 +129,8 @@ export async function interactionArguments(interaction, command) {
142
129
  return { args, group, subcommand };
143
130
  }
144
131
  if (command.fileType === 'ContextCommand') {
145
- if (command.type === 'user')
146
- return await interaction.client.users.fetch(interaction.targetId);
147
- if (command.type === 'message')
148
- return await interaction.channel.messages.fetch(interaction.targetId);
132
+ if (command.type === 'user') return await interaction.client.users.fetch(interaction.targetId);
133
+ if (command.type === 'message') return await interaction.channel.messages.fetch(interaction.targetId);
149
134
  }
150
135
  }
151
- //# sourceMappingURL=Arguments.js.map
136
+ //# sourceMappingURL=Arguments.js.map
@@ -4,4 +4,4 @@ export default class XernerxError {
4
4
  stack: {} | undefined;
5
5
  constructor(message?: string, error?: Error | unknown);
6
6
  }
7
- //# sourceMappingURL=XernerxError.d.ts.map
7
+ //# sourceMappingURL=XernerxError.d.ts.map
@@ -8,4 +8,4 @@ export default class XernerxError {
8
8
  this.stack = error || new Error().stack;
9
9
  }
10
10
  }
11
- //# sourceMappingURL=XernerxError.js.map
11
+ //# sourceMappingURL=XernerxError.js.map
@@ -12,4 +12,4 @@ export default class XernerxLog {
12
12
  error(message: string, error?: XernerxError | unknown): void | null;
13
13
  ready(): void;
14
14
  }
15
- //# sourceMappingURL=XernerxLog.d.ts.map
15
+ //# sourceMappingURL=XernerxLog.d.ts.map
@@ -18,7 +18,12 @@ export default class XernerxLog {
18
18
  }
19
19
  ready() {
20
20
  this.client.prependOnceListener('ready', async (synced) => {
21
- this.info(`${synced.user.tag} is now online, watching ${this.client.guilds.cache.size} guilds, using ${this.client.settings.local ? await this.client.guilds.fetch(this.client.settings.local) : 'none'} as local guild.`, this.readyLog);
21
+ this.info(
22
+ `${synced.user.tag} is now online, watching ${this.client.guilds.cache.size} guilds, using ${
23
+ this.client.settings.local ? await this.client.guilds.fetch(this.client.settings.local) : 'none'
24
+ } as local guild.`,
25
+ this.readyLog
26
+ );
22
27
  const files = [];
23
28
  for (const [id, data] of this.client.commands.message) {
24
29
  files.push(data);
@@ -46,4 +51,4 @@ export default class XernerxLog {
46
51
  });
47
52
  }
48
53
  }
49
- //# sourceMappingURL=XernerxLog.js.map
54
+ //# sourceMappingURL=XernerxLog.js.map
@@ -8,14 +8,10 @@ export interface XernerxUser extends User {
8
8
  export interface XernerxMember extends GuildMember {
9
9
  username: string;
10
10
  }
11
- export interface XernerxGuild extends Guild {
12
- }
13
- export interface XernerxGuildChannel extends GuildChannel {
14
- }
15
- export interface XernerxDMChannel extends DMChannel {
16
- }
17
- interface XernerxCommand {
18
- }
11
+ export interface XernerxGuild extends Guild {}
12
+ export interface XernerxGuildChannel extends GuildChannel {}
13
+ export interface XernerxDMChannel extends DMChannel {}
14
+ interface XernerxCommand {}
19
15
  export interface XernerxMessage extends Message, XernerxCommand {
20
16
  user: XernerxUser;
21
17
  util: MessageUtil;
@@ -30,4 +26,4 @@ export interface XernerxMessageContextInteraction extends MessageContextMenuComm
30
26
  util: InteractionUtil;
31
27
  }
32
28
  export {};
33
- //# sourceMappingURL=extenders.d.ts.map
29
+ //# sourceMappingURL=extenders.d.ts.map
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=extenders.js.map
2
+ //# sourceMappingURL=extenders.js.map
@@ -67,11 +67,14 @@ export interface DBLOptions {
67
67
  }
68
68
  export interface XernerxCache {
69
69
  messages: Collection<string, string>;
70
- cooldowns: Collection<string, {
71
- id: string;
72
- command: string;
73
- createdTimestamp: number;
74
- }>;
70
+ cooldowns: Collection<
71
+ string,
72
+ {
73
+ id: string;
74
+ command: string;
75
+ createdTimestamp: number;
76
+ }
77
+ >;
75
78
  }
76
79
  interface CommandHandlerOptions {
77
80
  directory: string;
@@ -228,4 +231,4 @@ export interface PresenceOptions {
228
231
  interval?: number;
229
232
  }
230
233
  export {};
231
- //# sourceMappingURL=interfaces.d.ts.map
234
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=interfaces.js.map
2
+ //# sourceMappingURL=interfaces.js.map
@@ -1,14 +1,182 @@
1
- import { SlashCommandBooleanOption, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandUserOption } from 'discord.js';
1
+ import {
2
+ SlashCommandBooleanOption,
3
+ SlashCommandChannelOption,
4
+ SlashCommandIntegerOption,
5
+ SlashCommandMentionableOption,
6
+ SlashCommandNumberOption,
7
+ SlashCommandRoleOption,
8
+ SlashCommandStringOption,
9
+ SlashCommandUserOption,
10
+ } from 'discord.js';
2
11
  import { XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from './extenders.js';
3
12
  export type FileType = 'MessageCommand' | 'SlashCommand' | 'ContextCommand' | 'Event' | 'Inhibitor';
4
- export type Locales = 'en-US' | 'en-GB' | 'bg' | 'zh-CN' | 'zh-TW' | 'hr' | 'cs' | 'da' | 'nl' | 'fi' | 'fr' | 'de' | 'el' | 'hi' | 'hu' | 'it' | 'ja' | 'ko' | 'lt' | 'no' | 'pl' | 'pt-BR' | 'ro' | 'ru' | 'es-ES' | 'sv-SE' | 'th' | 'tr' | 'uk' | 'vi';
13
+ export type Locales =
14
+ | 'en-US'
15
+ | 'en-GB'
16
+ | 'bg'
17
+ | 'zh-CN'
18
+ | 'zh-TW'
19
+ | 'hr'
20
+ | 'cs'
21
+ | 'da'
22
+ | 'nl'
23
+ | 'fi'
24
+ | 'fr'
25
+ | 'de'
26
+ | 'el'
27
+ | 'hi'
28
+ | 'hu'
29
+ | 'it'
30
+ | 'ja'
31
+ | 'ko'
32
+ | 'lt'
33
+ | 'no'
34
+ | 'pl'
35
+ | 'pt-BR'
36
+ | 'ro'
37
+ | 'ru'
38
+ | 'es-ES'
39
+ | 'sv-SE'
40
+ | 'th'
41
+ | 'tr'
42
+ | 'uk'
43
+ | 'vi';
5
44
  export type SlashCommandArgumentType = 'attachment' | 'boolean' | 'channel' | 'integer' | 'mentionable' | 'number' | 'role' | 'string' | 'user';
6
45
  export type SlashCommandOptionChoices = SlashCommandStringOption | SlashCommandNumberOption | SlashCommandIntegerOption;
7
46
  export type SlashCommandOption = SlashCommandOptionChoices | SlashCommandBooleanOption | SlashCommandUserOption | SlashCommandChannelOption | SlashCommandRoleOption | SlashCommandMentionableOption;
8
- export type MessageCommandArgumentType = 'string' | 'number' | 'boolean' | 'confirm' | 'channel' | 'guild' | 'integer' | 'mentionable' | 'role' | 'user' | 'message' | 'member' | 'list' | 'option' | 'rest';
9
- export type DiscordEventType = 'applicationCommandPermissionsUpdate' | 'autoModerationActionExecution' | 'autoModerationRuleCreate' | 'autoModerationRuleDelete' | 'autoModerationRuleUpdate' | 'ready' | 'guildCreate' | 'guildDelete' | 'guildUpdate' | 'guildUnavailable' | 'guildMemberAdd' | 'guildMemberRemove' | 'guildMemberUpdate' | 'guildMemberAvailable' | 'guildMembersChunk' | 'guildIntegrationsUpdate' | 'roleCreate' | 'roleDelete' | 'inviteCreate' | 'inviteDelete' | 'roleUpdate' | 'emojiCreate' | 'emojiDelete' | 'emojiUpdate' | 'guildBanAdd' | 'guildBanRemove' | 'channelCreate' | 'channelDelete' | 'channelUpdate' | 'channelPinsUpdate' | 'messageCreate' | 'messageDelete' | 'messageUpdate' | 'messageDeleteBulk' | 'messageReactionAdd' | 'messageReactionRemove' | 'messageReactionRemoveAll' | 'messageReactionRemoveEmoji' | 'threadCreate' | 'threadDelete' | 'threadUpdate' | 'threadListSync' | 'threadMemberUpdate' | 'threadMembersUpdate' | 'userUpdate' | 'presenceUpdate' | 'voiceServerUpdate' | 'voiceStateUpdate' | 'typingStart' | 'webhookUpdate' | 'interactionCreate' | 'error' | 'warn' | 'debug' | 'cacheSweep' | 'shardDisconnect' | 'shardError' | 'shardReconnecting' | 'shardReady' | 'shardResume' | 'invalidated' | 'raw' | 'stageInstanceCreate' | 'stageInstanceUpdate' | 'stageInstanceDelete' | 'stickerCreate' | 'stickerDelete' | 'stickerUpdate' | 'guildScheduledEventCreate' | 'guildScheduledEventUpdate' | 'guildScheduledEventDelete' | 'guildScheduledEventUserAdd' | 'guildScheduledEventUserRemove';
47
+ export type MessageCommandArgumentType =
48
+ | 'string'
49
+ | 'number'
50
+ | 'boolean'
51
+ | 'confirm'
52
+ | 'channel'
53
+ | 'guild'
54
+ | 'integer'
55
+ | 'mentionable'
56
+ | 'role'
57
+ | 'user'
58
+ | 'message'
59
+ | 'member'
60
+ | 'list'
61
+ | 'option'
62
+ | 'rest';
63
+ export type DiscordEventType =
64
+ | 'applicationCommandPermissionsUpdate'
65
+ | 'autoModerationActionExecution'
66
+ | 'autoModerationRuleCreate'
67
+ | 'autoModerationRuleDelete'
68
+ | 'autoModerationRuleUpdate'
69
+ | 'ready'
70
+ | 'guildCreate'
71
+ | 'guildDelete'
72
+ | 'guildUpdate'
73
+ | 'guildUnavailable'
74
+ | 'guildMemberAdd'
75
+ | 'guildMemberRemove'
76
+ | 'guildMemberUpdate'
77
+ | 'guildMemberAvailable'
78
+ | 'guildMembersChunk'
79
+ | 'guildIntegrationsUpdate'
80
+ | 'roleCreate'
81
+ | 'roleDelete'
82
+ | 'inviteCreate'
83
+ | 'inviteDelete'
84
+ | 'roleUpdate'
85
+ | 'emojiCreate'
86
+ | 'emojiDelete'
87
+ | 'emojiUpdate'
88
+ | 'guildBanAdd'
89
+ | 'guildBanRemove'
90
+ | 'channelCreate'
91
+ | 'channelDelete'
92
+ | 'channelUpdate'
93
+ | 'channelPinsUpdate'
94
+ | 'messageCreate'
95
+ | 'messageDelete'
96
+ | 'messageUpdate'
97
+ | 'messageDeleteBulk'
98
+ | 'messageReactionAdd'
99
+ | 'messageReactionRemove'
100
+ | 'messageReactionRemoveAll'
101
+ | 'messageReactionRemoveEmoji'
102
+ | 'threadCreate'
103
+ | 'threadDelete'
104
+ | 'threadUpdate'
105
+ | 'threadListSync'
106
+ | 'threadMemberUpdate'
107
+ | 'threadMembersUpdate'
108
+ | 'userUpdate'
109
+ | 'presenceUpdate'
110
+ | 'voiceServerUpdate'
111
+ | 'voiceStateUpdate'
112
+ | 'typingStart'
113
+ | 'webhookUpdate'
114
+ | 'interactionCreate'
115
+ | 'error'
116
+ | 'warn'
117
+ | 'debug'
118
+ | 'cacheSweep'
119
+ | 'shardDisconnect'
120
+ | 'shardError'
121
+ | 'shardReconnecting'
122
+ | 'shardReady'
123
+ | 'shardResume'
124
+ | 'invalidated'
125
+ | 'raw'
126
+ | 'stageInstanceCreate'
127
+ | 'stageInstanceUpdate'
128
+ | 'stageInstanceDelete'
129
+ | 'stickerCreate'
130
+ | 'stickerDelete'
131
+ | 'stickerUpdate'
132
+ | 'guildScheduledEventCreate'
133
+ | 'guildScheduledEventUpdate'
134
+ | 'guildScheduledEventDelete'
135
+ | 'guildScheduledEventUserAdd'
136
+ | 'guildScheduledEventUserRemove';
10
137
  export type EventType = DiscordEventType | 'webhookCreate' | 'webhookError' | 'commandBlock' | 'commandError' | 'commandStart' | 'commandFinish' | 'commandCooldown';
11
138
  export type XernerxInteraction = XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction;
12
- export type PermissionNames = 'create instant invite' | 'kick members' | 'ban members' | 'administrator' | 'manage channels' | 'manage guild' | 'add reactions' | 'view audit log' | 'priority speaker' | 'stream' | 'view channel' | 'send messages' | 'send tts messages' | 'manage messages' | 'embed links' | 'attach files' | 'read message history' | 'mention everyone' | 'use external emojis' | 'view guild insights' | 'connect' | 'speak' | 'mute members' | 'deafen members' | 'move members' | 'use vad' | 'change nickname' | 'manage nicknames' | 'manage roles' | 'manage webhooks' | 'manage emojis and stickers' | 'use application commands' | 'request to speak' | 'manage events' | 'manage threads' | 'create public threads' | 'create private threads' | 'use external stickers' | 'send messages in threads' | 'start embedded activities' | 'moderate members';
139
+ export type PermissionNames =
140
+ | 'create instant invite'
141
+ | 'kick members'
142
+ | 'ban members'
143
+ | 'administrator'
144
+ | 'manage channels'
145
+ | 'manage guild'
146
+ | 'add reactions'
147
+ | 'view audit log'
148
+ | 'priority speaker'
149
+ | 'stream'
150
+ | 'view channel'
151
+ | 'send messages'
152
+ | 'send tts messages'
153
+ | 'manage messages'
154
+ | 'embed links'
155
+ | 'attach files'
156
+ | 'read message history'
157
+ | 'mention everyone'
158
+ | 'use external emojis'
159
+ | 'view guild insights'
160
+ | 'connect'
161
+ | 'speak'
162
+ | 'mute members'
163
+ | 'deafen members'
164
+ | 'move members'
165
+ | 'use vad'
166
+ | 'change nickname'
167
+ | 'manage nicknames'
168
+ | 'manage roles'
169
+ | 'manage webhooks'
170
+ | 'manage emojis and stickers'
171
+ | 'use application commands'
172
+ | 'request to speak'
173
+ | 'manage events'
174
+ | 'manage threads'
175
+ | 'create public threads'
176
+ | 'create private threads'
177
+ | 'use external stickers'
178
+ | 'send messages in threads'
179
+ | 'start embedded activities'
180
+ | 'moderate members';
13
181
  export type InhibitorType = 'message' | 'interaction' | 'command' | 'channel' | 'user' | 'member' | 'guild' | 'contextCommand' | 'messageCommand' | 'slashCommand';
14
- //# sourceMappingURL=types.d.ts.map
182
+ //# sourceMappingURL=types.d.ts.map
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
2
+ //# sourceMappingURL=types.js.map
@@ -4,8 +4,8 @@ import Util from './Util.js';
4
4
  export default class ClientUtil extends Util {
5
5
  hasVoted?: Function;
6
6
  constructor(client: XernerxClient);
7
- setPresence(options: PresenceOptions): import("discord.js").ClientPresence | undefined;
8
- resolveChannel(query: string | Record<string, string>): Promise<import("discord.js").Channel | null>;
9
- resolveGuild(query: string | Record<string, string>): Promise<import("discord.js").Guild | null>;
7
+ setPresence(options: PresenceOptions): import('discord.js').ClientPresence | undefined;
8
+ resolveChannel(query: string | Record<string, string>): Promise<import('discord.js').Channel | null>;
9
+ resolveGuild(query: string | Record<string, string>): Promise<import('discord.js').Guild | null>;
10
10
  }
11
- //# sourceMappingURL=ClientUtil.d.ts.map
11
+ //# sourceMappingURL=ClientUtil.d.ts.map
@@ -8,30 +8,24 @@ export default class ClientUtil extends Util {
8
8
  return setPresence(this.client, options);
9
9
  }
10
10
  async resolveChannel(query) {
11
- if (typeof query == 'object')
12
- query = query.id;
11
+ if (typeof query == 'object') query = query.id;
13
12
  try {
14
- let channel = this.client.channels.cache.find((channel) => channel.name == query.toLowerCase() || channel.id == query.toLowerCase() ? channel : null) || null;
15
- if (!channel)
16
- channel = (await this.client.channels.fetch(query)) || null;
13
+ let channel = this.client.channels.cache.find((channel) => (channel.name == query.toLowerCase() || channel.id == query.toLowerCase() ? channel : null)) || null;
14
+ if (!channel) channel = (await this.client.channels.fetch(query)) || null;
17
15
  return channel;
18
- }
19
- catch {
16
+ } catch {
20
17
  return null;
21
18
  }
22
19
  }
23
20
  async resolveGuild(query) {
24
- if (typeof query == 'object')
25
- query = query.id;
21
+ if (typeof query == 'object') query = query.id;
26
22
  try {
27
23
  let guild = this.client.guilds.cache.find((guild) => guild.name.toLowerCase() == query.toLowerCase()) || null;
28
- if (!guild)
29
- guild = (await this.client.guilds.fetch(query)) || null;
24
+ if (!guild) guild = (await this.client.guilds.fetch(query)) || null;
30
25
  return guild;
31
- }
32
- catch {
26
+ } catch {
33
27
  return null;
34
28
  }
35
29
  }
36
30
  }
37
- //# sourceMappingURL=ClientUtil.js.map
31
+ //# sourceMappingURL=ClientUtil.js.map
@@ -5,7 +5,7 @@ import Util from './Util.js';
5
5
  export default class InteractionUtil extends Util {
6
6
  private interaction;
7
7
  constructor(client: XernerxClient, interaction: XernerxInteraction);
8
- reply(content: string | MessagePayload | InteractionReplyOptions | InteractionEditReplyOptions): Promise<import("discord.js").Message<boolean> | import("discord.js").InteractionResponse<boolean>>;
8
+ reply(content: string | MessagePayload | InteractionReplyOptions | InteractionEditReplyOptions): Promise<import('discord.js').Message<boolean> | import('discord.js').InteractionResponse<boolean>>;
9
9
  delay(time: number): Promise<unknown>;
10
10
  }
11
- //# sourceMappingURL=InteractionUtil.d.ts.map
11
+ //# sourceMappingURL=InteractionUtil.d.ts.map
@@ -13,4 +13,4 @@ export default class InteractionUtil extends Util {
13
13
  return await delay(time);
14
14
  }
15
15
  }
16
- //# sourceMappingURL=InteractionUtil.js.map
16
+ //# sourceMappingURL=InteractionUtil.js.map
@@ -9,8 +9,8 @@ export default class MessageUtil extends Util {
9
9
  prefix: null | string;
10
10
  };
11
11
  constructor(client: XernerxClient, message: XernerxMessage);
12
- reply(content: string | MessagePayload | MessageReplyOptions | MessageEditOptions): Promise<import("discord.js").Message<boolean> | null>;
12
+ reply(content: string | MessagePayload | MessageReplyOptions | MessageEditOptions): Promise<import('discord.js').Message<boolean> | null>;
13
13
  webhookReply(content: MessagePayload, url?: URL, user?: User): Promise<void>;
14
14
  delay(time: number): Promise<unknown>;
15
15
  }
16
- //# sourceMappingURL=MessageUtil.d.ts.map
16
+ //# sourceMappingURL=MessageUtil.d.ts.map
@@ -16,8 +16,7 @@ export default class MessageUtil extends Util {
16
16
  async reply(content) {
17
17
  if (this.client.cache.messages.has(this.message.id)) {
18
18
  const id = this.client.cache.messages.get(this.message.id);
19
- if (!id)
20
- return null;
19
+ if (!id) return null;
21
20
  const msg = await this.message.channel.messages.fetch(id);
22
21
  msg.edit(content);
23
22
  return msg;
@@ -27,8 +26,7 @@ export default class MessageUtil extends Util {
27
26
  return msg;
28
27
  }
29
28
  async webhookReply(content, url, user) {
30
- if (this.message.channel.type === ChannelType.DM)
31
- throw new XernerxError(`Can't use this method in DM Channels`);
29
+ if (this.message.channel.type === ChannelType.DM) throw new XernerxError(`Can't use this method in DM Channels`);
32
30
  const channel = this.message.channel;
33
31
  let webhook;
34
32
  if (!url) {
@@ -37,15 +35,13 @@ export default class MessageUtil extends Util {
37
35
  avatar: user?.avatarURL() || this.client.user?.avatarURL(),
38
36
  });
39
37
  }
40
- if (!webhook)
41
- webhook = { url };
38
+ if (!webhook) webhook = { url };
42
39
  await sendWebhook(webhook.url, content);
43
- if (!url)
44
- webhook.delete();
40
+ if (!url) webhook.delete();
45
41
  return;
46
42
  }
47
43
  async delay(time) {
48
44
  return await delay(time);
49
45
  }
50
46
  }
51
- //# sourceMappingURL=MessageUtil.js.map
47
+ //# sourceMappingURL=MessageUtil.js.map
@@ -3,4 +3,4 @@ export default class Util {
3
3
  client: XernerxClient;
4
4
  constructor(client: XernerxClient);
5
5
  }
6
- //# sourceMappingURL=Util.d.ts.map
6
+ //# sourceMappingURL=Util.d.ts.map
@@ -4,4 +4,4 @@ export default class Util {
4
4
  this.client = client;
5
5
  }
6
6
  }
7
- //# sourceMappingURL=Util.js.map
7
+ //# sourceMappingURL=Util.js.map
@@ -4,4 +4,4 @@ import SlashCommandBuilder from '../build/SlashCommandBuilder.js';
4
4
  import { XernerxMessage } from '../types/extenders.js';
5
5
  import { XernerxInteraction } from '../types/types.js';
6
6
  export default function commandValidation(event: XernerxInteraction | XernerxMessage, command: MessageCommandBuilder | SlashCommandBuilder | ContextCommandBuilder): Promise<boolean>;
7
- //# sourceMappingURL=commandValidation.d.ts.map
7
+ //# sourceMappingURL=commandValidation.d.ts.map