xernerx 4.17.7 → 5.0.2

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 (75) hide show
  1. package/README.md +14 -67
  2. package/dist/main.cjs +63 -0
  3. package/dist/main.cjs.map +1 -0
  4. package/dist/main.d.cts +21 -0
  5. package/dist/main.d.ts +20 -46
  6. package/dist/main.js +23 -49
  7. package/dist/main.js.map +1 -0
  8. package/package.json +63 -47
  9. package/src/main.ts +26 -0
  10. package/dist/build/XernerxContextCommand.d.ts +0 -82
  11. package/dist/build/XernerxContextCommand.js +0 -125
  12. package/dist/build/XernerxEvent.d.ts +0 -21
  13. package/dist/build/XernerxEvent.js +0 -27
  14. package/dist/build/XernerxInhibitor.d.ts +0 -53
  15. package/dist/build/XernerxInhibitor.js +0 -27
  16. package/dist/build/XernerxMessageCommand.d.ts +0 -84
  17. package/dist/build/XernerxMessageCommand.js +0 -123
  18. package/dist/build/XernerxSlashCommand.d.ts +0 -104
  19. package/dist/build/XernerxSlashCommand.js +0 -182
  20. package/dist/client/XernerxClient.d.ts +0 -70
  21. package/dist/client/XernerxClient.js +0 -106
  22. package/dist/client/XernerxShardClient.d.ts +0 -21
  23. package/dist/client/XernerxShardClient.js +0 -67
  24. package/dist/functions/deploy.d.ts +0 -3
  25. package/dist/functions/deploy.js +0 -56
  26. package/dist/functions/load.d.ts +0 -4
  27. package/dist/functions/load.js +0 -34
  28. package/dist/functions/reload.d.ts +0 -3
  29. package/dist/functions/reload.js +0 -29
  30. package/dist/functions/setPresence.d.ts +0 -4
  31. package/dist/functions/setPresence.js +0 -22
  32. package/dist/functions/xernerxUser.d.ts +0 -4
  33. package/dist/functions/xernerxUser.js +0 -10
  34. package/dist/handlers/CommandHandler.d.ts +0 -16
  35. package/dist/handlers/CommandHandler.js +0 -326
  36. package/dist/handlers/EventHandler.d.ts +0 -9
  37. package/dist/handlers/EventHandler.js +0 -56
  38. package/dist/handlers/ExtensionHandler.d.ts +0 -9
  39. package/dist/handlers/ExtensionHandler.js +0 -29
  40. package/dist/handlers/Handler.d.ts +0 -31
  41. package/dist/handlers/Handler.js +0 -52
  42. package/dist/handlers/InhibitorHandler.d.ts +0 -9
  43. package/dist/handlers/InhibitorHandler.js +0 -33
  44. package/dist/handlers/IntegrationHandler.d.ts +0 -15
  45. package/dist/handlers/IntegrationHandler.js +0 -26
  46. package/dist/models/Arguments.d.ts +0 -12
  47. package/dist/models/Arguments.js +0 -139
  48. package/dist/models/Cooldowns.d.ts +0 -11
  49. package/dist/models/Cooldowns.js +0 -29
  50. package/dist/tools/XernerxError.d.ts +0 -7
  51. package/dist/tools/XernerxError.js +0 -11
  52. package/dist/tools/XernerxIntents.d.ts +0 -6
  53. package/dist/tools/XernerxIntents.js +0 -26
  54. package/dist/tools/XernerxLog.d.ts +0 -31
  55. package/dist/tools/XernerxLog.js +0 -148
  56. package/dist/tools/XernerxText.d.ts +0 -31
  57. package/dist/tools/XernerxText.js +0 -84
  58. package/dist/types/extenders.d.ts +0 -84
  59. package/dist/types/extenders.js +0 -2
  60. package/dist/types/interfaces.d.ts +0 -263
  61. package/dist/types/interfaces.js +0 -2
  62. package/dist/types/types.d.ts +0 -111
  63. package/dist/types/types.js +0 -2
  64. package/dist/utils/ClientUtil.d.ts +0 -22
  65. package/dist/utils/ClientUtil.js +0 -102
  66. package/dist/utils/InteractionUtil.d.ts +0 -25
  67. package/dist/utils/InteractionUtil.js +0 -154
  68. package/dist/utils/MessageUtil.d.ts +0 -26
  69. package/dist/utils/MessageUtil.js +0 -168
  70. package/dist/utils/Util.d.ts +0 -12
  71. package/dist/utils/Util.js +0 -11
  72. package/dist/validators/commandValidation.d.ts +0 -10
  73. package/dist/validators/commandValidation.js +0 -167
  74. package/dist/validators/inhibitorValidations.d.ts +0 -28
  75. package/dist/validators/inhibitorValidations.js +0 -44
@@ -1,26 +0,0 @@
1
- /** @format */
2
- import { EmbedBuilder, MessageCreateOptions, MessageEditOptions, MessagePayload, MessageReplyOptions } from 'discord.js';
3
- import XernerxClient from '../client/XernerxClient.js';
4
- import { XernerxMessage, XernerxUser } from '../types/extenders.js';
5
- import Util from './Util.js';
6
- import { PaginatorOptions } from '../types/interfaces.js';
7
- import { PermissionNames } from '../main.js';
8
- type MimicOptions = {
9
- timeout: number;
10
- };
11
- export default class MessageUtil extends Util {
12
- private readonly message;
13
- parsed: {
14
- alias: string | null;
15
- prefix: string | null;
16
- args: Record<string, unknown> | null;
17
- };
18
- constructor(client: XernerxClient, message: XernerxMessage);
19
- send(content: any): Promise<import('discord.js').Message<boolean> | null>;
20
- reply(content: string | MessagePayload | MessageReplyOptions | MessageEditOptions): Promise<import('discord.js').Message<boolean> | null>;
21
- mimic(user: XernerxUser | string, message: MessageCreateOptions, options: MimicOptions): Promise<void>;
22
- paginator(embeds: Array<EmbedBuilder>, options?: PaginatorOptions): Promise<void | import('discord.js').Message<boolean> | null>;
23
- commands(): import('discord.js').Collection<string, import('../main.js').XernerxMessageCommand>;
24
- permissionCheck(type: 'user' | 'client', permissions: Array<PermissionNames>, emit?: boolean): boolean | string[];
25
- }
26
- export {};
@@ -1,168 +0,0 @@
1
- /** @format */
2
- import { ActionRowBuilder, ButtonBuilder, ButtonStyle, StringSelectMenuBuilder } from 'discord.js';
3
- import Util from './Util.js';
4
- import XernerxError from '../tools/XernerxError.js';
5
- import { Style } from 'dumfunctions';
6
- export default class MessageUtil extends Util {
7
- constructor(client, message) {
8
- super(client);
9
- this.message = message?.message || message;
10
- this.parsed = {
11
- alias: null,
12
- prefix: null,
13
- args: 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 mimic(user, message, options) {
41
- user = typeof user == 'string' ? await this.client.users.fetch(user) : user;
42
- const webhooks = await this.message.channel.fetchWebhooks();
43
- const webhook =
44
- webhooks.find((wh) => wh.token) ||
45
- (await this.message.channel.createWebhook({
46
- name: `${this.client.user?.username}'s mimic webhook.`,
47
- avatar: user.displayAvatarURL() || this.client.user?.displayAvatarURL(),
48
- }));
49
- await webhook.send({
50
- content: message.content,
51
- username: user.username,
52
- avatarURL: user.displayAvatarURL(),
53
- });
54
- setTimeout(() => {
55
- webhook.delete().catch(() => true);
56
- }, options.timeout);
57
- }
58
- async paginator(embeds, options = {}) {
59
- let buttonRow, menuRow;
60
- if (embeds.length <= 0) throw new XernerxError(`Can't make a paginator without embeds`);
61
- options = {
62
- type: options.type ?? 'combined',
63
- buttons: options.buttons ?? ['⏪', '◀️', '⏹️', '▶️', '⏩'],
64
- description: options.description ?? false,
65
- placeholder: options.placeholder ?? 'Change page',
66
- index: options.index ?? 0,
67
- send: options.send ?? false,
68
- filter: options.filter ?? (() => true),
69
- time: options.time ?? 300000,
70
- };
71
- if (options.type == 'button' || options.type == 'combined') {
72
- if (!options.buttons) throw new XernerxError(`¯\\_(ツ)_/¯ Somehow there are no buttons? ¯\\_(ツ)_/¯`);
73
- buttonRow = new ActionRowBuilder().addComponents(
74
- ...options.buttons.map((button, i) => new ButtonBuilder().setCustomId(`${this.message.id}-${i}`).setEmoji(button).setStyle(ButtonStyle.Primary))
75
- );
76
- }
77
- if (options.type == 'select-menu' || options.type == 'combined') {
78
- menuRow = new ActionRowBuilder().addComponents(
79
- new StringSelectMenuBuilder()
80
- .setCustomId(`${this.message.id}-select-menu`)
81
- .setPlaceholder(options.placeholder)
82
- .addOptions(...embeds.map((embed, i) => ({ label: embed.data.title || 'No Title', description: (options.description ? embed.data.description : undefined) || undefined, value: `${i}` })))
83
- );
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)) return;
101
- if (collect.customId.endsWith('select-menu')) {
102
- index = Number(collect.values[0]);
103
- collect.update({ embeds: [embeds[index]] });
104
- } else {
105
- const option = Number(collect.customId.split(/-/)[1]);
106
- let embed = embeds[index];
107
- if (option == 0) {
108
- index = 0;
109
- embed = embeds[index];
110
- collect.update({ embeds: [embed] });
111
- }
112
- if (option == 1) {
113
- index = embeds.indexOf(embed) >= 1 ? embeds.indexOf(embed) - 1 : 0;
114
- embed = embeds[index];
115
- collect.update({ embeds: [embed] });
116
- }
117
- if (option == 2) {
118
- collect.update({ components: [] });
119
- collector?.stop();
120
- }
121
- if (option == 3) {
122
- index = embeds.indexOf(embed) < embeds.length - 1 ? embeds.indexOf(embed) + 1 : embeds.length - 1;
123
- embed = embeds[index];
124
- collect.update({ embeds: [embed] });
125
- }
126
- if (option == 4) {
127
- index = embeds.length - 1;
128
- embed = embeds[index];
129
- collect.update({ embeds: [embed] });
130
- }
131
- }
132
- })
133
- .on('end', async () => {
134
- await msg?.edit({ components: [] });
135
- });
136
- });
137
- }
138
- commands() {
139
- return this.client.commands.message;
140
- }
141
- permissionCheck(type, permissions, emit = true) {
142
- const missing = [];
143
- for (const permission of permissions) {
144
- if (type == 'user') {
145
- this.message.member?.permissionsIn(this.message.channel.id).has(Style.pascalCase(permission, true)) ? null : missing.push(permission);
146
- }
147
- if (type == 'client') {
148
- this.message.guild?.members.me?.permissionsIn(this.message.channel.id).has(Style.pascalCase(permission, true)) ? null : missing.push(permission);
149
- }
150
- }
151
- const command = this.commands().find((cmd) => cmd.name == this.parsed.alias || cmd.aliases?.includes(this.parsed.alias));
152
- if (missing.length && emit) {
153
- this.client.emit(
154
- `commandBlock`,
155
- this.message,
156
- {
157
- reason: `missing${Style.pascalCase(type)}Permissions`,
158
- message: `${type == 'user' ? 'You are' : 'I am'} missing the following permissions to run \`${command?.name}\`:\n${missing.map((permission) => `> - ${permission}`).join('\n')}`,
159
- required: permissions,
160
- missing,
161
- },
162
- command || null
163
- );
164
- return false;
165
- } else if (missing.length && !emit) return missing;
166
- else return true;
167
- }
168
- }
@@ -1,12 +0,0 @@
1
- /** @format */
2
- import XernerxClient from '../client/XernerxClient.js';
3
- import XernerxText from '../tools/XernerxText.js';
4
- export default class Util {
5
- readonly client: XernerxClient<{
6
- [index: string]: any;
7
- [index: number]: any;
8
- }>;
9
- readonly text: XernerxText;
10
- constructor(client: XernerxClient);
11
- delay(time: number): Promise<unknown>;
12
- }
@@ -1,11 +0,0 @@
1
- /** @format */
2
- import XernerxText from '../tools/XernerxText.js';
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
- }
11
- }
@@ -1,10 +0,0 @@
1
- /** @format */
2
- import XernerxContextCommand from '../build/XernerxContextCommand.js';
3
- import MessageCommandBuilder from '../build/XernerxMessageCommand.js';
4
- import XernerxSlashCommand from '../build/XernerxSlashCommand.js';
5
- import { XernerxMessage, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';
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>;
@@ -1,167 +0,0 @@
1
- /** @format */
2
- import { ChannelType } from 'discord.js';
3
- import { Style } from 'dumfunctions';
4
- var CommandTypes;
5
- (function (CommandTypes) {
6
- CommandTypes['SlashCommand'] = 'slash';
7
- CommandTypes['MessageCommand'] = 'message';
8
- CommandTypes['ContextCommand'] = 'context';
9
- })(CommandTypes || (CommandTypes = {}));
10
- export default async function commandValidation(event, command) {
11
- const client = event.client;
12
- if (command.ignore?.owner && client.settings.ownerId?.includes(event.user.id)) return false;
13
- const cooldownTime = command.cooldown || client.modules.options?.[CommandTypes[command.filetype]]?.cooldown || client.cooldown?.default || 0;
14
- const cooldown = {
15
- id: event.user.id,
16
- command: command.name,
17
- createdTimestamp: Number(Date.now()) + cooldownTime,
18
- };
19
- const clientPermissions = command.permissions?.client || client.modules.options?.[CommandTypes[command.filetype]]?.permissions?.client || client.settings.permissions?.client || [];
20
- const userPermissions = command.permissions?.user || client.modules.options?.[CommandTypes[command.filetype]]?.permissions?.user || client.settings.permissions?.user || [];
21
- if (!client.cooldowns.collections.commands.has(`${event.user.id}-${command.name}`)) {
22
- client.cooldowns.collections.commands.set(`${event.user.id}-${command.name}`, cooldown);
23
- setTimeout(() => {
24
- client.cooldowns.collections.commands.delete(`${event.user.id}-${command.name}`);
25
- }, cooldownTime);
26
- } else {
27
- const user = client.cooldowns.collections.commands.get(`${event.user.id}-${command.name}`);
28
- const time = (user?.createdTimestamp || 0) - Number(Date.now());
29
- return emit(
30
- event,
31
- {
32
- reason: 'cooldown',
33
- message: `You are on cooldown for \`${command.name}\`, wait another \`${Math.round(time / 10) / 100}s\``,
34
- startedAt: user.createdTimestamp,
35
- endsAt: user.createdTimestamp + time,
36
- time,
37
- },
38
- command
39
- );
40
- }
41
- if (command.channel && event.channel?.type !== undefined && event.channel?.type >= 0) {
42
- if (!command.channel.includes(ChannelType[event.channel?.type]))
43
- return await emit(
44
- event,
45
- {
46
- reason: 'invalidChannel',
47
- message: `\`${command.name}\` can only be used in ${command.channel.join(', ')} channels`,
48
- channels: command.channel,
49
- },
50
- command
51
- );
52
- }
53
- if ((command.ignore?.channels?.length || 0) > 0 && command.ignore?.channels?.includes(event.channel?.id)) return true;
54
- if ((command.ignore?.guilds?.length || 0) > 0 && command.ignore?.guilds?.includes(event.guild?.id)) return true;
55
- if ((command.ignore?.users?.length || 0) > 0 && command.ignore?.users?.includes(event.user.id)) return true;
56
- if (command.ignore?.voice && event.member?.voice?.channel)
57
- return await emit(
58
- event,
59
- {
60
- reason: 'inVoice',
61
- message: `\`${command.name}\` cannot be ran while in voice chat`,
62
- },
63
- command
64
- );
65
- if (command.strict?.owner && !client.settings.ownerId.includes(event.user.id))
66
- return await emit(
67
- event,
68
- {
69
- reason: 'notADeveloper',
70
- message: `\`${command.name}\` is a developer command`,
71
- owners: client.settings.ownerId,
72
- },
73
- command
74
- );
75
- if ((command.strict?.channels?.length || 0) > 0 && !command.strict?.channels?.includes(event.channel?.id))
76
- return await emit(
77
- event,
78
- {
79
- reason: 'channelRestricted',
80
- message: `\`${command.name}\` cannot be ran in this channel`,
81
- channels: command.strict?.channels,
82
- },
83
- command
84
- );
85
- if ((command.strict?.guilds?.length || 0) > 0 && !command.strict?.guilds?.includes(event.guild?.id))
86
- return await emit(
87
- event,
88
- {
89
- reason: 'guildRestricted',
90
- message: `\`${command.name}\` cannot be ran in this guild`,
91
- guilds: command.strict?.guilds,
92
- },
93
- command
94
- );
95
- if ((command.strict?.users?.length || 0) > 0 && !command.strict?.users?.includes(event.user.id))
96
- return await emit(
97
- event,
98
- {
99
- reason: 'userRestricted',
100
- message: `\`${command.name}\` cannot be ran by you`,
101
- users: command.strict?.users,
102
- },
103
- command
104
- );
105
- if (command.strict?.voice && !event.member?.voice?.channel)
106
- return await emit(
107
- event,
108
- {
109
- reason: 'voiceRestricted',
110
- message: `\`${command.name}\` cannot be ran while not in voice chat`,
111
- },
112
- command
113
- );
114
- if (command.permissions?.dm == false && event.channel?.type === ChannelType.DM)
115
- return await emit(
116
- event,
117
- {
118
- reason: 'DMRestricted',
119
- message: `\`${command.name}\` can't be used in a DM Channel`,
120
- },
121
- command
122
- );
123
- if (userPermissions.length) {
124
- const missing = [];
125
- userPermissions.map((permission) => ((event.member?.permissions).toArray().includes(Style.pascalCase(permission, true)) ? null : missing.push(permission)));
126
- if (missing.length)
127
- return await emit(
128
- event,
129
- {
130
- reason: 'missingUserPermissions',
131
- message: `You are missing the following permissions to run \`${command.name}\`:\n${missing.map((permission) => `> - ${permission}`).join('\n')}`,
132
- required: userPermissions,
133
- missing,
134
- },
135
- command
136
- );
137
- }
138
- if (clientPermissions.length) {
139
- const missing = [];
140
- clientPermissions.map((permission) => (event.guild?.members.me?.permissionsIn(event.channel?.id).has(Style.pascalCase(permission, true)) ? null : missing.push(permission)));
141
- if (missing.length)
142
- return await emit(
143
- event,
144
- {
145
- reason: 'missingClientPermissions',
146
- message: `I am missing the following permissions to run \`${command.name}\`:\n${missing.map((permission) => `> - ${permission}`).join('\n')}`,
147
- required: clientPermissions,
148
- missing,
149
- },
150
- command
151
- );
152
- }
153
- if ((!command.global || !client.settings.global) && client.settings.local !== event.guild?.id)
154
- return await emit(
155
- event,
156
- {
157
- reason: 'local',
158
- message: `\`${command.name}\` is not globally deployed`,
159
- },
160
- command
161
- );
162
- return false;
163
- }
164
- async function emit(event, info, command) {
165
- event.client.emit('commandBlock', event, info, command);
166
- return true;
167
- }
@@ -1,28 +0,0 @@
1
- /** @format */
2
- import { ContextCommandArguments, MessageCommandArguments, SlashCommandArguments } from '../types/interfaces.js';
3
- import XernerxContextCommand from '../build/XernerxContextCommand.js';
4
- import XernerxMessageCommand from '../build/XernerxMessageCommand.js';
5
- import XernerxSlashCommand from '../build/XernerxSlashCommand.js';
6
- import { XernerxMessage, XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';
7
- import { InhibitorType, XernerxInteraction } from '../types/types.js';
8
- export declare function inhibitorValidation(
9
- event: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,
10
- args?: SlashCommandArguments | MessageCommandArguments | ContextCommandArguments<'user' | 'message'> | null,
11
- cmd?: XernerxContextCommand | XernerxMessageCommand | XernerxSlashCommand,
12
- type?: 'pre' | 'check' | 'post'
13
- ): Promise<boolean>;
14
- export declare function inhibitorArguments(
15
- event: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>,
16
- cmd: XernerxContextCommand | XernerxMessageCommand | XernerxSlashCommand | null,
17
- type: InhibitorType
18
- ):
19
- | import('../types/extenders.js').XernerxUser
20
- | import('discord.js').GuildMember
21
- | import('discord.js').Guild
22
- | import('discord.js').TextBasedChannel
23
- | XernerxSlashCommand
24
- | XernerxContextCommand
25
- | XernerxMessageCommand
26
- | import('discord.js').APIInteractionGuildMember
27
- | null
28
- | undefined;
@@ -1,44 +0,0 @@
1
- /** @format */
2
- export async function inhibitorValidation(event, args, cmd, type) {
3
- const client = event.client;
4
- const inhibits = [];
5
- for (const [name, inhibitor] of client.inhibitors) {
6
- if (type == 'pre')
7
- if (Boolean(await inhibitor.pre(event, await inhibitorArguments(event, cmd || null, inhibitor.type)))) {
8
- inhibits.push(name);
9
- }
10
- if (type == 'check')
11
- if (Boolean(await inhibitor.check(event, args || null, await inhibitorArguments(event, cmd || null, inhibitor.type)))) {
12
- inhibits.push(name);
13
- }
14
- if (type == 'post')
15
- if (Boolean(await inhibitor.post(event, args || null, await inhibitorArguments(event, cmd || null, inhibitor.type)))) {
16
- inhibits.push(name);
17
- }
18
- }
19
- return !!inhibits.length;
20
- }
21
- export function inhibitorArguments(event, cmd, type) {
22
- switch (type) {
23
- case 'channel':
24
- return event.channel || null;
25
- case 'command':
26
- return cmd || null;
27
- case 'contextCommand':
28
- return cmd || null;
29
- case 'guild':
30
- return event.guild || null;
31
- case 'interaction':
32
- return null;
33
- case 'member':
34
- return event.member || null;
35
- case 'message':
36
- return null;
37
- case 'messageCommand':
38
- return cmd || null;
39
- case 'slashCommand':
40
- return cmd || null;
41
- case 'user':
42
- return event.user || null;
43
- }
44
- }