xernerx 4.4.9 → 4.4.11
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/ContextCommandBuilder.js +1 -0
- package/dist/build/ContextCommandBuilder.js.map +1 -0
- package/dist/build/EventBuilder.js +1 -0
- package/dist/build/EventBuilder.js.map +1 -0
- package/dist/build/InhibitorBuilder.js +1 -2
- package/dist/build/InhibitorBuilder.js.map +1 -0
- package/dist/build/MessageCommandBuilder.js +1 -0
- package/dist/build/MessageCommandBuilder.js.map +1 -0
- package/dist/build/SlashCommandBuilder.js +1 -0
- package/dist/build/SlashCommandBuilder.js.map +1 -0
- package/dist/client/XernerxClient.js +6 -5
- package/dist/client/XernerxClient.js.map +1 -0
- package/dist/functions/deploy.js +1 -0
- package/dist/functions/deploy.js.map +1 -0
- package/dist/functions/isOwner.js +1 -0
- package/dist/functions/isOwner.js.map +1 -0
- package/dist/functions/isVoter.js +1 -0
- package/dist/functions/isVoter.js.map +1 -0
- package/dist/functions/load.js +1 -0
- package/dist/functions/load.js.map +1 -0
- package/dist/functions/reload.js +1 -0
- package/dist/functions/reload.js.map +1 -0
- package/dist/functions/setPresence.js +1 -0
- package/dist/functions/setPresence.js.map +1 -0
- package/dist/functions/xernerxUser.js +1 -0
- package/dist/functions/xernerxUser.js.map +1 -0
- package/dist/handlers/CommandHandler.js +2 -1
- package/dist/handlers/CommandHandler.js.map +1 -0
- package/dist/handlers/EventHandler.js +1 -0
- package/dist/handlers/EventHandler.js.map +1 -0
- package/dist/handlers/ExtensionHandler.js +2 -1
- package/dist/handlers/ExtensionHandler.js.map +1 -0
- package/dist/handlers/Handler.js +1 -0
- package/dist/handlers/Handler.js.map +1 -0
- package/dist/handlers/InhibitorHandler.js +1 -0
- package/dist/handlers/InhibitorHandler.js.map +1 -0
- package/dist/handlers/WebhookHandler.js +1 -0
- package/dist/handlers/WebhookHandler.js.map +1 -0
- package/dist/main.js +1 -0
- package/dist/main.js.map +13 -0
- package/dist/models/Arguments.js +2 -1
- package/dist/models/Arguments.js.map +1 -0
- package/dist/tools/XernerxLog.js +6 -0
- package/dist/tools/XernerxLog.js.map +1 -0
- package/dist/types/interfaces.js +1 -0
- package/dist/types/interfaces.js.map +1 -0
- package/dist/utils/ClientUtil.js +1 -0
- package/dist/utils/ClientUtil.js.map +1 -0
- package/dist/utils/InteractionUtil.js +1 -0
- package/dist/utils/InteractionUtil.js.map +1 -0
- package/dist/utils/MessageUtil.js +1 -0
- package/dist/utils/MessageUtil.js.map +1 -0
- package/dist/utils/Util.js +1 -0
- package/dist/utils/Util.js.map +1 -0
- package/dist/validators/commandValidation.js +1 -0
- package/dist/validators/commandValidation.js.map +1 -0
- package/package.json +1 -1
- package/dist/build/ContextCommandBuilder.d.ts +0 -42
- package/dist/build/EventBuilder.d.ts +0 -24
- package/dist/build/InhibitorBuilder.d.ts +0 -19
- package/dist/build/MessageCommandBuilder.d.ts +0 -41
- package/dist/build/SlashCommandBuilder.d.ts +0 -47
- package/dist/client/XernerxClient.d.ts +0 -47
- package/dist/client/XernerxShardClient.d.ts +0 -16
- package/dist/client/XernerxShardClient.js +0 -30
- package/dist/functions/delay.d.ts +0 -1
- package/dist/functions/delay.js +0 -3
- package/dist/functions/deploy.d.ts +0 -2
- package/dist/functions/isOwner.d.ts +0 -3
- package/dist/functions/isVoter.d.ts +0 -3
- package/dist/functions/load.d.ts +0 -3
- package/dist/functions/reload.d.ts +0 -2
- package/dist/functions/sendWebhook.d.ts +0 -2
- package/dist/functions/sendWebhook.js +0 -13
- package/dist/functions/setPresence.d.ts +0 -3
- package/dist/functions/xernerxUser.d.ts +0 -3
- package/dist/handlers/CommandHandler.d.ts +0 -13
- package/dist/handlers/EventHandler.d.ts +0 -7
- package/dist/handlers/ExtensionHandler.d.ts +0 -7
- package/dist/handlers/Handler.d.ts +0 -14
- package/dist/handlers/InhibitorHandler.d.ts +0 -7
- package/dist/handlers/WebhookHandler.d.ts +0 -9
- package/dist/main.d.ts +0 -35
- package/dist/models/Arguments.d.ts +0 -8
- package/dist/tools/XernerxError.d.ts +0 -6
- package/dist/tools/XernerxError.js +0 -10
- package/dist/tools/XernerxLog.d.ts +0 -14
- package/dist/types/extenders.d.ts +0 -32
- package/dist/types/extenders.js +0 -1
- package/dist/types/interfaces.d.ts +0 -230
- package/dist/types/types.d.ts +0 -13
- package/dist/types/types.js +0 -1
- package/dist/utils/ClientUtil.d.ts +0 -10
- package/dist/utils/InteractionUtil.d.ts +0 -10
- package/dist/utils/MessageUtil.d.ts +0 -15
- package/dist/utils/Util.d.ts +0 -5
- package/dist/validators/commandValidation.d.ts +0 -6
- package/dist/validators/inhibitorValidations.d.ts +0 -5
- package/dist/validators/inhibitorValidations.js +0 -34
package/dist/utils/ClientUtil.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientUtil.js","sourceRoot":"","sources":["../../src/utils/ClientUtil.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,6BAA6B,CAAC;AAGtD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,IAAI;IAGxC,YAAY,MAAqB;QAC7B,KAAK,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAEM,WAAW,CAAC,OAAwB;QACvC,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,KAAsC;QAC9D,IAAI,OAAO,KAAK,IAAI,QAAQ;YAAE,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC;QAE/C,IAAI;YACA,IAAI,OAAO,GACP,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAI,OAAU,EAAE,EAAE,CAC7C,OAAkC,CAAC,IAAI,IAAK,KAAgB,CAAC,WAAW,EAAE,IAAK,OAAkC,CAAC,EAAE,IAAK,KAAgB,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAC5K,IAAI,IAAI,CAAC;YAEd,IAAI,CAAC,OAAO;gBAAE,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC;YAE1E,OAAO,OAAO,CAAC;SAClB;QAAC,MAAM;YACJ,OAAO,IAAI,CAAC;SACf;IACL,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,KAAsC;QAC5D,IAAI,OAAO,KAAK,IAAI,QAAQ;YAAE,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC;QAE/C,IAAI;YACA,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,IAAK,KAAgB,CAAC,WAAW,EAAE,CAAC,IAAI,IAAI,CAAC;YAE1H,IAAI,CAAC,KAAK;gBAAE,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC;YAEpE,OAAO,KAAK,CAAC;SAChB;QAAC,MAAM;YACJ,OAAO,IAAI,CAAC;SACf;IACL,CAAC;CACJ","sourcesContent":["import setPresence from '../functions/setPresence.js';\nimport XernerxClient from '../client/XernerxClient.js';\nimport { PresenceOptions } from '../types/interfaces.js';\nimport Util from './Util.js';\n\nexport default class ClientUtil extends Util {\n public declare hasVoted?: Function;\n\n constructor(client: XernerxClient) {\n super(client);\n }\n\n public setPresence(options: PresenceOptions) {\n return setPresence(this.client, options);\n }\n\n public async resolveChannel(query: string | Record<string, string>) {\n if (typeof query == 'object') query = query.id;\n\n try {\n let channel =\n this.client.channels.cache.find(<T>(channel: T) =>\n (channel as Record<string, string>).name == (query as string).toLowerCase() || (channel as Record<string, string>).id == (query as string).toLowerCase() ? channel : null\n ) || null;\n\n if (!channel) channel = (await this.client.channels.fetch(query)) || null;\n\n return channel;\n } catch {\n return null;\n }\n }\n\n public async resolveGuild(query: string | Record<string, string>) {\n if (typeof query == 'object') query = query.id;\n\n try {\n let guild = this.client.guilds.cache.find((guild) => guild.name.toLowerCase() == (query as string).toLowerCase()) || null;\n\n if (!guild) guild = (await this.client.guilds.fetch(query)) || null;\n\n return guild;\n } catch {\n return null;\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractionUtil.js","sourceRoot":"","sources":["../../src/utils/InteractionUtil.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAG1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,IAAI;IACrC,WAAW,CAAC;IAEpB,YAAY,MAAqB,EAAE,WAA+B;QAC9D,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,OAAuB;QACtC,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACjJ,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,IAAY;QAC3B,OAAO,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;CACJ","sourcesContent":["import { MessagePayload } from 'discord.js';\n\nimport delay from '../functions/delay.js';\nimport XernerxClient from '../client/XernerxClient.js';\nimport { XernerxInteraction } from '../types/types.js';\nimport Util from './Util.js';\n\nexport default class InteractionUtil extends Util {\n private interaction;\n\n constructor(client: XernerxClient, interaction: XernerxInteraction) {\n super(client);\n\n this.interaction = interaction;\n }\n\n public async reply(content: MessagePayload) {\n return await (this.interaction.replied || this.interaction.deferred ? this.interaction.editReply(content) : this.interaction.reply(content));\n }\n\n public async delay(time: number) {\n return await delay(time);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageUtil.js","sourceRoot":"","sources":["../../src/utils/MessageUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgE,MAAM,YAAY,CAAC;AAEvG,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAG1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,IAAI;IACxB,OAAO,CAAC;IAOzB,YAAY,MAAqB,EAAE,OAAuB;QACtD,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,MAAM,GAAG;YACV,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;SACf,CAAC;IACN,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,OAAuB;QACtC,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;YACjD,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAE3D,IAAI,CAAC,EAAE;gBAAE,OAAO;YAEhB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAA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cesContent":["import { ChannelType, ForumChannel, MessagePayload, NewsChannel, TextChannel, User } from 'discord.js';\n\nimport delay from '../functions/delay.js';\nimport XernerxClient from '../client/XernerxClient.js';\nimport { XernerxMessage } from '../types/extenders.js';\nimport Util from './Util.js';\nimport sendWebhook from '../functions/sendWebhook.js';\nimport XernerxError from '../tools/XernerxError.js';\n\nexport default class MessageUtil extends Util {\n private readonly message;\n\n public declare parsed: {\n alias: null | string;\n prefix: null | string;\n };\n\n constructor(client: XernerxClient, message: XernerxMessage) {\n super(client);\n\n this.message = message;\n\n this.parsed = {\n alias: null,\n prefix: null,\n };\n }\n\n public async reply(content: MessagePayload) {\n if (this.client.cache.messages.has(this.message.id)) {\n const id = this.client.cache.messages.get(this.message.id);\n\n if (!id) return;\n\n const msg = await this.message.channel.messages.fetch(id);\n\n msg.edit(content);\n\n return msg;\n }\n\n const msg = await this.message.reply(content);\n\n this.client.cache.messages.set(this.message.id, msg.id);\n\n return msg;\n }\n\n public async webhookReply(content: MessagePayload, url?: URL, user?: User) {\n if (this.message.channel.type === ChannelType.DM) throw new XernerxError(`Can't use this method in DM Channels`);\n\n const channel = this.message.channel as TextChannel | NewsChannel | ForumChannel;\n\n let webhook;\n\n if (!url) {\n webhook = await channel.createWebhook({\n name: user?.username || (this.client.user?.username as string),\n avatar: user?.avatarURL() || this.client.user?.avatarURL(),\n });\n }\n\n if (!webhook) webhook = { url };\n\n await sendWebhook(webhook.url as URL, content);\n\n if (!url) (webhook as Record<'delete', Function>).delete();\n\n return;\n }\n\n public async delay(time: number) {\n return await delay(time);\n }\n}\n"]}
|
package/dist/utils/Util.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Util.js","sourceRoot":"","sources":["../../src/utils/Util.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,OAAO,IAAI;IACd,MAAM,CAAC;IAEd,YAAY,MAAqB;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;CACJ","sourcesContent":["import XernerxClient from '../client/XernerxClient.js';\n\nexport default class Util {\n public client;\n\n constructor(client: XernerxClient) {\n this.client = client;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandValidation.js","sourceRoot":"","sources":["../../src/validators/commandValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAqB,MAAM,YAAY,CAAC;AASjF,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,iBAAiB,CAAC,KAA0C,EAAE,OAA4E;IACpK,MAAM,MAAM,GAAG,KAAK,CAAC,MAAuB,CAAC;IAE7C,IAAI,OAAO,CAAC,MAAM,EAAE,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,KAAK,CAAC;IAE3F,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE;QACjE,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,OAAO,CAAC,IAAI,EAAE,EAAE;YAC3D,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE;YACjB,OAAO,EAAE,OAAO,CAAC,IAAI;YACrB,gBAAgB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC;SACjE,CAAC,CAAC;QAEH,UAAU,CAAC,GAAG,EAAE;YACZ,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACtE,CAAC,EAAE,O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,UAAU,IAAI,CAAC,KAA0C,EAAE,MAAc;IAC1E,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACjD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,QAAQ,CAAC,WAAmD;IACjE,IAAI,iBAAiB,GAAG,EAAE,CAAC;IAE3B,WAAW,CAAC,GAAG,CAAC,CAAC,UAA2B,EAAE,EAAE;QAC5C,UAAU;YACN,mBAAmB,CACd,UAAqB;iBACjB,KAAK,CAAC,IAAI,CAAC;iBACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;iBACzE,IAAI,CAAC,EAAE,CAAsB,CACrC,CAAC;QAEN,IAAI,OAAO,UAAU,KAAK,QAAQ;YAAE,iBAAiB,IAAI,UAAU,CAAC;IACxE,CAAC,CAAC,CAAC;IAEH,OAAO,iBAAiB,CAAC;AAC7B,CAAC","sourcesContent":["import { ChannelType, PermissionFlagsBits, PermissionsString } from 'discord.js';\n\nimport ContextCommandBuilder from '../build/ContextCommandBuilder.js';\nimport MessageCommandBuilder from '../build/MessageCommandBuilder.js';\nimport SlashCommandBuilder from '../build/SlashCommandBuilder.js';\nimport XernerxClient from '../client/XernerxClient.js';\nimport { XernerxMessage } from '../types/extenders.js';\nimport { PermissionNames, XernerxInteraction } from '../types/types.js';\n\nexport default async function commandValidation(event: XernerxInteraction | XernerxMessage, command: MessageCommandBuilder | SlashCommandBuilder | ContextCommandBuilder) {\n const client = event.client as XernerxClient;\n\n if (command.ignore?.owner && client.settings.ownerId.includes(event.user.id)) return false;\n\n if (!client.cache.cooldowns.has(`${event.user.id}-${command.name}`)) {\n client.cache.cooldowns.set(`${event.user.id}-${command.name}`, {\n id: event.user.id,\n command: command.name,\n createdTimestamp: Number(Date.now()) + (command.cooldown || 0),\n });\n\n setTimeout(() => {\n client.cache.cooldowns.delete(`${event.user.id}-${command.name}`);\n }, command.cooldown || 0);\n } else {\n const user = client.cache.cooldowns.get(`${event.user.id}-${command.name}`);\n\n const time = (user?.createdTimestamp || 0) - Number(Date.now());\n\n return emit(event, `Command on cooldown, ${time}`);\n }\n\n if ((command.ignore?.channels?.length || 0) > 0 && command.ignore?.channels?.includes(event.channel?.id as string)) return true;\n\n if ((command.ignore?.guilds?.length || 0) > 0 && command.ignore?.guilds?.includes(event.guild?.id as string)) return true;\n\n if ((command.ignore?.users?.length || 0) > 0 && command.ignore?.users?.includes(event.user.id as string)) return true;\n\n if (command.strict?.owner && !client.settings.ownerId.includes(event.user.id)) return await emit(event, 'Command is a developer command');\n\n if ((command.strict?.channels?.length || 0) > 0 && !command.strict?.channels?.includes(event.channel?.id as string)) return await emit(event, 'Command cannot be ran in this channel');\n\n if ((command.strict?.guilds?.length || 0) > 0 && !command.strict?.guilds?.includes(event.guild?.id as string)) return await emit(event, 'Command cannot be ran in this guild');\n\n if ((command.strict?.users?.length || 0) > 0 && !command.strict?.users?.includes(event.user.id)) return await emit(event, 'Command cannot be ran by you');\n\n if (command.permissions?.dm == false && event.channel?.type === ChannelType.DM) return await emit(event, \"Can't use in a DM Channel\");\n\n if (command.permissions?.user) {\n if (!(event.member?.permissions as Record<'has', Function>).has(toBigInt(command.permissions.user))) return await emit(event, 'Missing User Permissions');\n }\n\n return false;\n}\n\nasync function emit(event: XernerxInteraction | XernerxMessage, reason: string) {\n event.client.emit('commandBlock', event, reason);\n return true;\n}\n\nfunction toBigInt(permissions: Array<PermissionNames> | Array<string>) {\n let bigIntPermissions = 0n;\n\n permissions.map((permission: string | bigint) => {\n permission =\n PermissionFlagsBits[\n (permission as string)\n .split(/ +/)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join('') as PermissionsString\n ];\n\n if (typeof permission === 'bigint') bigIntPermissions += permission;\n });\n\n return bigIntPermissions;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ContextMenuCommandBuilder } from 'discord.js';
|
|
2
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
3
|
-
import { XernerxMessage, XernerxMessageContextInteraction, XernerxUser, XernerxUserContextInteraction } from '../types/extenders.js';
|
|
4
|
-
import { ContextCommandOptions } from '../types/interfaces.js';
|
|
5
|
-
export default class ContextCommandBuilder {
|
|
6
|
-
readonly id: string;
|
|
7
|
-
readonly data: ContextMenuCommandBuilder;
|
|
8
|
-
readonly name: string;
|
|
9
|
-
readonly type: 'user' | 'message';
|
|
10
|
-
readonly description: string | null | undefined;
|
|
11
|
-
readonly usage: string | null | undefined;
|
|
12
|
-
readonly info: string | null | undefined;
|
|
13
|
-
readonly category: string | null | undefined;
|
|
14
|
-
readonly cooldown: number | null | undefined;
|
|
15
|
-
readonly ignore: {
|
|
16
|
-
owner?: boolean | undefined;
|
|
17
|
-
users?: string[] | undefined;
|
|
18
|
-
channels?: string[] | undefined;
|
|
19
|
-
guilds?: string[] | undefined;
|
|
20
|
-
} | undefined;
|
|
21
|
-
readonly strict: {
|
|
22
|
-
owner?: boolean | undefined;
|
|
23
|
-
users?: string[] | undefined;
|
|
24
|
-
channels?: string[] | undefined;
|
|
25
|
-
guilds?: string[] | undefined;
|
|
26
|
-
} | undefined;
|
|
27
|
-
readonly permissions: {
|
|
28
|
-
user?: string[] | import("../types/types.js").PermissionNames[] | undefined;
|
|
29
|
-
client?: string[] | import("../types/types.js").PermissionNames[] | undefined;
|
|
30
|
-
dm?: boolean | undefined;
|
|
31
|
-
} | undefined;
|
|
32
|
-
readonly defer: {
|
|
33
|
-
reply?: boolean | undefined;
|
|
34
|
-
ephemeral?: boolean | undefined;
|
|
35
|
-
fetchReply?: boolean | undefined;
|
|
36
|
-
} | undefined;
|
|
37
|
-
readonly fileType: 'ContextCommand';
|
|
38
|
-
readonly filePath: string;
|
|
39
|
-
readonly client: typeof XernerxClient;
|
|
40
|
-
constructor(id: string, options: ContextCommandOptions);
|
|
41
|
-
exec<T>(interaction: XernerxUserContextInteraction | XernerxMessageContextInteraction, args: XernerxUser | XernerxMessage): Promise<void | T | undefined>;
|
|
42
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import { EventBuilderOptions } from '../types/interfaces.js';
|
|
3
|
-
import { EventType } from '../types/types.js';
|
|
4
|
-
/**
|
|
5
|
-
* @description - The event builder for events.
|
|
6
|
-
* @param {String} id - The unique ID of the event.
|
|
7
|
-
* @param {EventOptions} options - The event options.
|
|
8
|
-
*/
|
|
9
|
-
export default class EventBuilder {
|
|
10
|
-
readonly id: string;
|
|
11
|
-
readonly name: EventType | string;
|
|
12
|
-
readonly emitter?: 'client' | 'process' | string;
|
|
13
|
-
readonly type?: 'discord' | string;
|
|
14
|
-
readonly once?: boolean;
|
|
15
|
-
readonly fileType: 'Event';
|
|
16
|
-
readonly filePath: string;
|
|
17
|
-
readonly client: typeof XernerxClient;
|
|
18
|
-
constructor(id: string, options: EventBuilderOptions);
|
|
19
|
-
/**
|
|
20
|
-
* @description run your custom event here.
|
|
21
|
-
* TODO - update description
|
|
22
|
-
*/
|
|
23
|
-
run<T>(...args: Array<T>): Promise<void | undefined | T>;
|
|
24
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import { InhibitorBuilderOptions } from '../types/interfaces.js';
|
|
3
|
-
import { InhibitorType } from '../types/types.js';
|
|
4
|
-
import { XernerxMessage, XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';
|
|
5
|
-
/**
|
|
6
|
-
* @description - The inhibitor builder for inhibitors.
|
|
7
|
-
* @param {String} id - The unique ID of the inhibitor.
|
|
8
|
-
* @param {InhibitorOptions} options - The inhibitor options.
|
|
9
|
-
*/
|
|
10
|
-
export default class InhibitorBuilder {
|
|
11
|
-
readonly id: string;
|
|
12
|
-
readonly name: string;
|
|
13
|
-
readonly type: InhibitorType;
|
|
14
|
-
readonly fileType: 'Inhibitor';
|
|
15
|
-
readonly filePath: string;
|
|
16
|
-
readonly client: typeof XernerxClient;
|
|
17
|
-
constructor(id: string, options: InhibitorBuilderOptions);
|
|
18
|
-
check<T>(interaction: XernerxMessage | XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction, args: T): Promise<void | undefined | T>;
|
|
19
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import { XernerxMessage } from '../types/extenders.js';
|
|
3
|
-
import { MessageCommandOptions } from '../types/interfaces.js';
|
|
4
|
-
export default class MessageCommandBuilder {
|
|
5
|
-
readonly id: string;
|
|
6
|
-
readonly name: string;
|
|
7
|
-
readonly aliases: string[] | undefined;
|
|
8
|
-
readonly regex: RegExp | undefined;
|
|
9
|
-
readonly prefix: string | string[] | undefined;
|
|
10
|
-
readonly description: string | null | undefined;
|
|
11
|
-
readonly usage: string | null | undefined;
|
|
12
|
-
readonly info: string | null | undefined;
|
|
13
|
-
readonly separator: string | undefined;
|
|
14
|
-
readonly args: import("../types/interfaces.js").MessageCommandArgumentOptions[] | undefined;
|
|
15
|
-
readonly flags: import("../types/interfaces.js").MessageCommandFlagOptions[] | undefined;
|
|
16
|
-
readonly category: string | null | undefined;
|
|
17
|
-
readonly cooldown: number | null | undefined;
|
|
18
|
-
readonly ignore: {
|
|
19
|
-
owner?: boolean | undefined;
|
|
20
|
-
users?: string[] | undefined;
|
|
21
|
-
channels?: string[] | undefined;
|
|
22
|
-
guilds?: string[] | undefined;
|
|
23
|
-
} | undefined;
|
|
24
|
-
readonly strict: {
|
|
25
|
-
owner?: boolean | undefined;
|
|
26
|
-
users?: string[] | undefined;
|
|
27
|
-
channels?: string[] | undefined;
|
|
28
|
-
guilds?: string[] | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
readonly permissions: {
|
|
31
|
-
user?: string[] | import("../types/types.js").PermissionNames[] | undefined;
|
|
32
|
-
client?: string[] | import("../types/types.js").PermissionNames[] | undefined;
|
|
33
|
-
dm?: boolean | undefined;
|
|
34
|
-
} | undefined;
|
|
35
|
-
readonly fileType: 'MessageCommand';
|
|
36
|
-
readonly filePath: string;
|
|
37
|
-
readonly client: typeof XernerxClient;
|
|
38
|
-
constructor(id: string, options: MessageCommandOptions);
|
|
39
|
-
conditions<T>(message: XernerxMessage, { args, flags }: any): Promise<void | undefined | T>;
|
|
40
|
-
exec<T>(message: XernerxMessage, { args, flags }: any): Promise<void | undefined | T>;
|
|
41
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import Discord from 'discord.js';
|
|
2
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
3
|
-
import { XernerxSlashInteraction } from '../types/extenders.js';
|
|
4
|
-
import { SlashCommandOptions } from '../types/interfaces.js';
|
|
5
|
-
import { XernerxInteraction } from '../types/types.js';
|
|
6
|
-
export default class SlashCommandBuilder {
|
|
7
|
-
readonly id: string;
|
|
8
|
-
readonly data: Discord.SlashCommandBuilder;
|
|
9
|
-
readonly name: string;
|
|
10
|
-
readonly description: string;
|
|
11
|
-
readonly usage: string | null | undefined;
|
|
12
|
-
readonly info: string | null | undefined;
|
|
13
|
-
readonly category: string | null | undefined;
|
|
14
|
-
readonly cooldown: number | null | undefined;
|
|
15
|
-
readonly ignore: {
|
|
16
|
-
owner?: boolean | undefined;
|
|
17
|
-
users?: string[] | undefined;
|
|
18
|
-
channels?: string[] | undefined;
|
|
19
|
-
guilds?: string[] | undefined;
|
|
20
|
-
} | undefined;
|
|
21
|
-
readonly strict: {
|
|
22
|
-
owner?: boolean | undefined;
|
|
23
|
-
users?: string[] | undefined;
|
|
24
|
-
channels?: string[] | undefined;
|
|
25
|
-
guilds?: string[] | undefined;
|
|
26
|
-
} | undefined;
|
|
27
|
-
readonly permissions: {
|
|
28
|
-
user?: string[] | import("../types/types.js").PermissionNames[] | undefined;
|
|
29
|
-
client?: string[] | import("../types/types.js").PermissionNames[] | undefined;
|
|
30
|
-
dm?: boolean | undefined;
|
|
31
|
-
} | undefined;
|
|
32
|
-
readonly defer: {
|
|
33
|
-
reply?: boolean | undefined;
|
|
34
|
-
ephemeral?: boolean | undefined;
|
|
35
|
-
fetchReply?: boolean | undefined;
|
|
36
|
-
} | undefined;
|
|
37
|
-
readonly fileType: 'SlashCommand';
|
|
38
|
-
readonly filePath: string;
|
|
39
|
-
readonly client: typeof XernerxClient;
|
|
40
|
-
constructor(id: string, options: SlashCommandOptions);
|
|
41
|
-
autocomplete<T>(interaction: XernerxInteraction, focused: T, options: T[]): Promise<void | undefined | T>;
|
|
42
|
-
conditions<T>(interaction: XernerxSlashInteraction, { args, subcommand, group }: any): Promise<void | undefined | T>;
|
|
43
|
-
exec<T>(interaction: XernerxSlashInteraction, { args, subcommand, group }: any): Promise<void | undefined | T>;
|
|
44
|
-
private addArguments;
|
|
45
|
-
private addSubcommands;
|
|
46
|
-
private addSubcommandGroups;
|
|
47
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Client, ClientOptions, Collection } from 'discord.js';
|
|
2
|
-
import { XernerxOptions, ModuleOptions, XernerxCommands, XernerxCache } from '../types/interfaces.js';
|
|
3
|
-
import ClientUtil from '../utils/ClientUtil.js';
|
|
4
|
-
import { InhibitorBuilder, EventBuilder } from '../main.js';
|
|
5
|
-
export default class XernerxClient extends Client {
|
|
6
|
-
readonly settings: {
|
|
7
|
-
ownerId: (string | string[]) & (string | string[] | undefined);
|
|
8
|
-
global: boolean;
|
|
9
|
-
local?: string | undefined;
|
|
10
|
-
permissions?: {
|
|
11
|
-
client: string[];
|
|
12
|
-
user: string[];
|
|
13
|
-
dm: boolean;
|
|
14
|
-
} | undefined;
|
|
15
|
-
ignore?: {
|
|
16
|
-
owner: boolean;
|
|
17
|
-
users: string[];
|
|
18
|
-
channels: string[];
|
|
19
|
-
guilds: string[];
|
|
20
|
-
} | undefined;
|
|
21
|
-
log?: {
|
|
22
|
-
ready: boolean;
|
|
23
|
-
error: boolean;
|
|
24
|
-
info: boolean;
|
|
25
|
-
table: string[] | null;
|
|
26
|
-
} | undefined;
|
|
27
|
-
cooldown?: {
|
|
28
|
-
command: number;
|
|
29
|
-
cache: number;
|
|
30
|
-
} | undefined;
|
|
31
|
-
};
|
|
32
|
-
readonly config: Record<string, unknown> | null;
|
|
33
|
-
readonly commands: XernerxCommands;
|
|
34
|
-
readonly events: Collection<string, EventBuilder>;
|
|
35
|
-
readonly inhibitors: Collection<string, InhibitorBuilder>;
|
|
36
|
-
readonly modules: ModuleOptions;
|
|
37
|
-
readonly util: ClientUtil;
|
|
38
|
-
readonly stats: {
|
|
39
|
-
guildCount: number;
|
|
40
|
-
userCount: number;
|
|
41
|
-
shardId: number;
|
|
42
|
-
shardCount: number;
|
|
43
|
-
};
|
|
44
|
-
readonly cache: XernerxCache;
|
|
45
|
-
constructor(discordOptions: ClientOptions, xernerxOptions: XernerxOptions, config?: Record<string, unknown>);
|
|
46
|
-
connect(token: string): void;
|
|
47
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ShardingManager, ShardingManagerOptions, ClientUser } from 'discord.js';
|
|
2
|
-
interface XernerxOptions {
|
|
3
|
-
log?: {
|
|
4
|
-
ready?: boolean;
|
|
5
|
-
};
|
|
6
|
-
}
|
|
7
|
-
export default class XernerxShardClient extends ShardingManager {
|
|
8
|
-
readonly stats: {
|
|
9
|
-
guildCount: number;
|
|
10
|
-
userCount: number;
|
|
11
|
-
shardCount: number;
|
|
12
|
-
};
|
|
13
|
-
user: ClientUser | null;
|
|
14
|
-
constructor(file: string, discordOptions: ShardingManagerOptions, xernerxOptions?: XernerxOptions);
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ShardingManager } from 'discord.js';
|
|
2
|
-
import XernerxLog from '../tools/XernerxLog.js';
|
|
3
|
-
export default class XernerxShardClient extends ShardingManager {
|
|
4
|
-
constructor(file, discordOptions, xernerxOptions) {
|
|
5
|
-
super(file, discordOptions);
|
|
6
|
-
this.stats = { guildCount: 0, userCount: 0, shardCount: 0 };
|
|
7
|
-
this.user = null;
|
|
8
|
-
this.on('shardCreate', async (shard) => {
|
|
9
|
-
shard.on('ready', async () => {
|
|
10
|
-
const guilds = (await shard.fetchClientValue('guilds.cache'));
|
|
11
|
-
const guildCount = guilds.length;
|
|
12
|
-
const userCount = guilds.map((guild) => guild.memberCount).length ? guilds.map((guild) => guild.memberCount).reduce((a, b) => (a += b)) : 0;
|
|
13
|
-
this.stats.guildCount += Number(guildCount);
|
|
14
|
-
this.stats.userCount += Number(userCount);
|
|
15
|
-
this.stats.shardCount++;
|
|
16
|
-
this.user = (await shard.fetchClientValue('user'));
|
|
17
|
-
});
|
|
18
|
-
new XernerxLog({ settings: xernerxOptions }).info(`Launching shard ${shard.id} for ${this.user?.tag}!`);
|
|
19
|
-
});
|
|
20
|
-
this.spawn().then(async (shards) => {
|
|
21
|
-
const collector = setInterval(() => {
|
|
22
|
-
const index = shards.size - 1;
|
|
23
|
-
if (shards.get(index)?.ready) {
|
|
24
|
-
new XernerxLog({ settings: xernerxOptions }).info(`Launched all ${this.stats.shardCount} shards for ${this.user?.tag}, watching ${this.stats.guildCount} guilds, and ${this.stats.userCount} users!`);
|
|
25
|
-
clearInterval(collector);
|
|
26
|
-
}
|
|
27
|
-
}, 1000);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function delay(time: number): Promise<unknown>;
|
package/dist/functions/delay.js
DELETED
package/dist/functions/load.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export default async function sendWebhook(url, body) {
|
|
2
|
-
const response = await fetch(url, {
|
|
3
|
-
method: 'POST',
|
|
4
|
-
headers: {
|
|
5
|
-
'Content-Type': 'application/json',
|
|
6
|
-
},
|
|
7
|
-
body: JSON.stringify(body),
|
|
8
|
-
});
|
|
9
|
-
if (response.status === 204)
|
|
10
|
-
return true;
|
|
11
|
-
const data = await response.json();
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import { XernerxMessage, XernerxSlashInteraction, XernerxUser, XernerxUserContextInteraction } from '../types/extenders.js';
|
|
3
|
-
export declare function xernerxUser(event: XernerxMessage | XernerxSlashInteraction | XernerxUserContextInteraction | XernerxUserContextInteraction, client: XernerxClient): Promise<XernerxUser>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import { ContextHandlerOptions, MessageHandlerOptions, SlashHandlerOptions } from '../types/interfaces.js';
|
|
3
|
-
import Handler from './Handler.js';
|
|
4
|
-
export default class CommandHandler extends Handler {
|
|
5
|
-
constructor(client: XernerxClient);
|
|
6
|
-
loadMessageCommands(options: MessageHandlerOptions): void;
|
|
7
|
-
loadSlashCommands(options: SlashHandlerOptions): void;
|
|
8
|
-
loadContextCommands(options: ContextHandlerOptions): void;
|
|
9
|
-
private messageCommandRun;
|
|
10
|
-
private slashCommandRun;
|
|
11
|
-
private contextCommandRun;
|
|
12
|
-
private exec;
|
|
13
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import { EventHandlerOptions } from '../types/interfaces.js';
|
|
3
|
-
import Handler from './Handler.js';
|
|
4
|
-
export default class EventHandler extends Handler {
|
|
5
|
-
constructor(client: XernerxClient);
|
|
6
|
-
loadEvents(options: EventHandlerOptions): Promise<void>;
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import XernerxExtensionBuilder from 'xernerx-extension-builder';
|
|
2
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
3
|
-
import Handler from './Handler.js';
|
|
4
|
-
export default class ExtensionHandler extends Handler {
|
|
5
|
-
constructor(client: XernerxClient);
|
|
6
|
-
loadExtensions(...extensions: Array<XernerxExtensionBuilder>): void;
|
|
7
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import MessageCommandBuilder from '../build/MessageCommandBuilder.js';
|
|
3
|
-
import SlashCommandBuilder from '../build/SlashCommandBuilder.js';
|
|
4
|
-
import ContextCommandBuilder from '../build/ContextCommandBuilder.js';
|
|
5
|
-
import { FileType } from '../types/types.js';
|
|
6
|
-
export default class Handler {
|
|
7
|
-
readonly client: XernerxClient;
|
|
8
|
-
readonly files: Array<MessageCommandBuilder | SlashCommandBuilder | ContextCommandBuilder>;
|
|
9
|
-
readonly readyTimestamp: number;
|
|
10
|
-
constructor(client: XernerxClient);
|
|
11
|
-
readdir(dir: string): string[];
|
|
12
|
-
load(filePath: string, type: FileType): Promise<any>;
|
|
13
|
-
emit<T extends Record<string, string | boolean | Function | void>>(event: T): Promise<void>;
|
|
14
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import Handler from './Handler.js';
|
|
3
|
-
import { InhibitorHandlerOptions } from '../types/interfaces.js';
|
|
4
|
-
export default class InhibitorHandler extends Handler {
|
|
5
|
-
constructor(client: XernerxClient);
|
|
6
|
-
loadInhibitors(options: InhibitorHandlerOptions): Promise<void>;
|
|
7
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import Handler from './Handler.js';
|
|
3
|
-
export default class WebhookHandler extends Handler {
|
|
4
|
-
constructor(client: XernerxClient);
|
|
5
|
-
loadWebhooks(options: {
|
|
6
|
-
token: string;
|
|
7
|
-
}): Promise<void>;
|
|
8
|
-
private post;
|
|
9
|
-
}
|
package/dist/main.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import XernerxClient from './client/XernerxClient.js';
|
|
2
|
-
import XernerxShardClient from './client/XernerxShardClient.js';
|
|
3
|
-
import MessageCommandBuilder from './build/MessageCommandBuilder.js';
|
|
4
|
-
import SlashCommandBuilder from './build/SlashCommandBuilder.js';
|
|
5
|
-
import ContextCommandBuilder from './build/ContextCommandBuilder.js';
|
|
6
|
-
import EventBuilder from './build/EventBuilder.js';
|
|
7
|
-
import InhibitorBuilder from './build/InhibitorBuilder.js';
|
|
8
|
-
import XernerxLog from './tools/XernerxLog.js';
|
|
9
|
-
export * from 'discord.js';
|
|
10
|
-
export * from 'dumfunctions';
|
|
11
|
-
import ExtensionBuilder from 'xernerx-extension-builder';
|
|
12
|
-
import Discord from 'discord.js';
|
|
13
|
-
declare const version: any;
|
|
14
|
-
export default XernerxClient;
|
|
15
|
-
export {
|
|
16
|
-
/**
|
|
17
|
-
** Clients
|
|
18
|
-
*/
|
|
19
|
-
XernerxClient, XernerxShardClient,
|
|
20
|
-
/**
|
|
21
|
-
** Builders
|
|
22
|
-
*/
|
|
23
|
-
MessageCommandBuilder, SlashCommandBuilder, ContextCommandBuilder, EventBuilder, InhibitorBuilder, ExtensionBuilder,
|
|
24
|
-
/**
|
|
25
|
-
** Imported exports
|
|
26
|
-
*/
|
|
27
|
-
Discord,
|
|
28
|
-
/**
|
|
29
|
-
** Properties
|
|
30
|
-
*/
|
|
31
|
-
version,
|
|
32
|
-
/**
|
|
33
|
-
** Tools
|
|
34
|
-
*/
|
|
35
|
-
XernerxLog, };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import SlashCommandBuilder from '../build/SlashCommandBuilder.js';
|
|
2
|
-
import ContextCommandBuilder from '../build/ContextCommandBuilder.js';
|
|
3
|
-
import MessageCommandBuilder from '../build/MessageCommandBuilder.js';
|
|
4
|
-
import { XernerxMessage } from '../types/extenders.js';
|
|
5
|
-
import { MessageCommandArguments } from '../types/interfaces.js';
|
|
6
|
-
import { XernerxInteraction } from '../types/types.js';
|
|
7
|
-
export declare function messageArguments(message: XernerxMessage, command: MessageCommandBuilder): Promise<MessageCommandArguments>;
|
|
8
|
-
export declare function interactionArguments(interaction: XernerxInteraction | any, command: ContextCommandBuilder | SlashCommandBuilder): Promise<any>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import XernerxError from './XernerxError.js';
|
|
2
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
3
|
-
export default class XernerxLog {
|
|
4
|
-
private readonly client;
|
|
5
|
-
private readonly errorLog;
|
|
6
|
-
private readonly infoLog;
|
|
7
|
-
private readonly readyLog;
|
|
8
|
-
private readonly tableLog;
|
|
9
|
-
constructor(client: XernerxClient);
|
|
10
|
-
info(message: string, force?: boolean): void | null;
|
|
11
|
-
warn(message: string): void | null;
|
|
12
|
-
error(message: string, error?: XernerxError | unknown): void | null;
|
|
13
|
-
ready(): void;
|
|
14
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ChatInputCommandInteraction, DMChannel, Guild, GuildChannel, GuildMember, Message, MessageContextMenuCommandInteraction, User, UserContextMenuCommandInteraction } from 'discord.js';
|
|
2
|
-
import InteractionUtil from '../utils/InteractionUtil.js';
|
|
3
|
-
import MessageUtil from '../utils/MessageUtil.js';
|
|
4
|
-
export interface XernerxUser extends User {
|
|
5
|
-
owner: boolean;
|
|
6
|
-
voted: boolean | null;
|
|
7
|
-
}
|
|
8
|
-
export interface XernerxMember extends GuildMember {
|
|
9
|
-
username: string;
|
|
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
|
-
}
|
|
19
|
-
export interface XernerxMessage extends Message, XernerxCommand {
|
|
20
|
-
user: XernerxUser;
|
|
21
|
-
util: MessageUtil;
|
|
22
|
-
}
|
|
23
|
-
export interface XernerxSlashInteraction extends ChatInputCommandInteraction, XernerxCommand {
|
|
24
|
-
util: InteractionUtil;
|
|
25
|
-
}
|
|
26
|
-
export interface XernerxUserContextInteraction extends UserContextMenuCommandInteraction, XernerxCommand {
|
|
27
|
-
util: InteractionUtil;
|
|
28
|
-
}
|
|
29
|
-
export interface XernerxMessageContextInteraction extends MessageContextMenuCommandInteraction, XernerxCommand {
|
|
30
|
-
util: InteractionUtil;
|
|
31
|
-
}
|
|
32
|
-
export {};
|
package/dist/types/extenders.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|