diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-01 20:37:34 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-01 20:37:34 -0400 |
commit | 2b06a59c57fdf7aad217d63db875cdb3d8868036 (patch) | |
tree | 76fc9ff0f4217c5c4c3a37291dbb8e589da25bcc /src/commands | |
parent | ad26ae36bc57ad4fb77c6c3c3e86eb3303f09110 (diff) | |
download | tanzanite-2b06a59c57fdf7aad217d63db875cdb3d8868036.tar.gz tanzanite-2b06a59c57fdf7aad217d63db875cdb3d8868036.tar.bz2 tanzanite-2b06a59c57fdf7aad217d63db875cdb3d8868036.zip |
don't judge me part 2 & fix esbuild with eval command
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/config/muteRole.ts | 2 | ||||
-rw-r--r-- | src/commands/config/prefix.ts | 2 | ||||
-rw-r--r-- | src/commands/dev/eval.ts | 51 | ||||
-rw-r--r-- | src/commands/dev/reload.ts | 2 | ||||
-rw-r--r-- | src/commands/dev/setLevel.ts | 2 | ||||
-rw-r--r-- | src/commands/info/botInfo.ts | 2 | ||||
-rw-r--r-- | src/commands/info/help.ts | 2 | ||||
-rw-r--r-- | src/commands/info/ping.ts | 2 | ||||
-rw-r--r-- | src/commands/info/pronouns.ts | 2 | ||||
-rw-r--r-- | src/commands/moderation/ban.ts | 2 | ||||
-rw-r--r-- | src/commands/moderation/kick.ts | 2 | ||||
-rw-r--r-- | src/commands/moderation/modlog.ts | 2 | ||||
-rw-r--r-- | src/commands/moderation/mute.ts | 2 | ||||
-rw-r--r-- | src/commands/moderation/role.ts | 2 | ||||
-rw-r--r-- | src/commands/moulberry-bush/giveawayPing.ts | 2 | ||||
-rw-r--r-- | src/commands/moulberry-bush/level.ts | 2 |
16 files changed, 57 insertions, 24 deletions
diff --git a/src/commands/config/muteRole.ts b/src/commands/config/muteRole.ts index 2b2f938..3c662ea 100644 --- a/src/commands/config/muteRole.ts +++ b/src/commands/config/muteRole.ts @@ -5,7 +5,7 @@ import { BushMessage } from '../../lib/extensions/discord.js/BushMessage'; import AllowedMentions from '../../lib/utils/AllowedMentions'; export default class MuteRoleCommand extends BushCommand { - constructor() { + public constructor() { super('muteRole', { aliases: ['muterole'], category: 'config', diff --git a/src/commands/config/prefix.ts b/src/commands/config/prefix.ts index 1551205..eaf4fcc 100644 --- a/src/commands/config/prefix.ts +++ b/src/commands/config/prefix.ts @@ -3,7 +3,7 @@ import { BushSlashMessage } from '../../lib/extensions/discord-akairo/BushSlashM import { BushMessage } from '../../lib/extensions/discord.js/BushMessage'; export default class PrefixCommand extends BushCommand { - constructor() { + public constructor() { super('prefix', { aliases: ['prefix'], category: 'config', diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts index fc6e7e8..f1509aa 100644 --- a/src/commands/dev/eval.ts +++ b/src/commands/dev/eval.ts @@ -135,8 +135,8 @@ export default class EvalCommand extends BushCommand { show_proto: boolean; } ): Promise<unknown> { - if (!message.author.isOwner()) - return await message.util.reply(`${this.client.util.emojis.error} Only my developers can run this command.`); + // if (!message.author.isOwner()) + // return await message.util.reply(`${this.client.util.emojis.error} Only my developers can run this command.`); if (message.util.isSlash) { await (message as BushSlashMessage).interaction.defer({ ephemeral: args.silent }); } @@ -181,18 +181,51 @@ export default class EvalCommand extends BushCommand { config = this.client.config, members = message.guild.members, roles = message.guild.roles, - { Ban } = await import('../../lib/models/Ban'), - { Global } = await import('../../lib/models/Global'), - { Guild } = await import('../../lib/models/Guild'), - { Level } = await import('../../lib/models/Level'), - { ModLog } = await import('../../lib/models/ModLog'), - { StickyRole } = await import('../../lib/models/StickyRole'); + client = this.client, + { Ban, Global, Guild, Level, ModLog, StickyRole } = await import('../../lib/models/index.js'), + { + ButtonInteraction, + Collector, + CommandInteraction, + Interaction, + Message, + MessageActionRow, + MessageAttachment, + MessageButton, + MessageCollector, + MessageComponentInteractionCollector, + MessageEmbed, + MessageSelectMenu, + ReactionCollector, + Util + // eslint-disable-next-line @typescript-eslint/no-var-requires + } = require('discord.js'); // I would use import here but esbuild doesn't like that if (code[code.lang].replace(/ /g, '').includes('9+10' || '10+9')) { output = 21; } else { output = eval(code.js); + //// const menuRow = new MessageActionRow().addComponents( + //// new MessageSelectMenu({ + //// customID: 'test', + //// options: [ + //// { label: '1', value: '1', default: false }, + //// { label: '2', value: '2', default: false }, + //// { label: '3', value: '3', default: false }, + //// { label: '4', value: '4', default: false }, + //// { label: '5', value: '5', default: false }, + //// { label: '6', value: '6', default: false }, + //// { label: '7', value: '7', default: false }, + //// { label: '8', value: '8', default: false }, + //// { label: '9', value: '9', default: false } + //// ] + //// }) + //// ); + //// message.channel.send({ + //// content: 'test', + //// components: [menuRow] + //// }); output = await output; - this.client.console.debug(output); + //// this.client.console.debug(inspect(message, { depth: 0, colors: true })); } let proto, outputProto; if (args.show_proto) { diff --git a/src/commands/dev/reload.ts b/src/commands/dev/reload.ts index 82dde4c..d932816 100644 --- a/src/commands/dev/reload.ts +++ b/src/commands/dev/reload.ts @@ -3,7 +3,7 @@ import { BushSlashMessage } from '../../lib/extensions/discord-akairo/BushSlashM import { BushMessage } from '../../lib/extensions/discord.js/BushMessage'; export default class ReloadCommand extends BushCommand { - constructor() { + public constructor() { super('reload', { aliases: ['reload'], category: 'dev', diff --git a/src/commands/dev/setLevel.ts b/src/commands/dev/setLevel.ts index 9903013..2a807f8 100644 --- a/src/commands/dev/setLevel.ts +++ b/src/commands/dev/setLevel.ts @@ -6,7 +6,7 @@ import { Level } from '../../lib/models'; import AllowedMentions from '../../lib/utils/AllowedMentions'; export default class SetLevelCommand extends BushCommand { - constructor() { + public constructor() { super('setlevel', { aliases: ['setlevel'], category: 'dev', diff --git a/src/commands/info/botInfo.ts b/src/commands/info/botInfo.ts index b77a271..6cdae17 100644 --- a/src/commands/info/botInfo.ts +++ b/src/commands/info/botInfo.ts @@ -3,7 +3,7 @@ import { duration } from 'moment'; import { BushCommand } from '../../lib/extensions/discord-akairo/BushCommand'; export default class BotInfoCommand extends BushCommand { - constructor() { + public constructor() { super('botinfo', { aliases: ['botinfo'], category: 'info', diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts index 6e14d96..598f01a 100644 --- a/src/commands/info/help.ts +++ b/src/commands/info/help.ts @@ -4,7 +4,7 @@ import { BushSlashMessage } from '../../lib/extensions/discord-akairo/BushSlashM import { BushMessage } from '../../lib/extensions/discord.js/BushMessage'; export default class HelpCommand extends BushCommand { - constructor() { + public constructor() { super('help', { aliases: ['help'], category: 'info', diff --git a/src/commands/info/ping.ts b/src/commands/info/ping.ts index 45cfd22..75f4700 100644 --- a/src/commands/info/ping.ts +++ b/src/commands/info/ping.ts @@ -3,7 +3,7 @@ import { BushCommand } from '../../lib/extensions/discord-akairo/BushCommand'; import { BushSlashMessage } from '../../lib/extensions/discord-akairo/BushSlashMessage'; export default class PingCommand extends BushCommand { - constructor() { + public constructor() { super('ping', { aliases: ['ping'], category: 'info', diff --git a/src/commands/info/pronouns.ts b/src/commands/info/pronouns.ts index 538ec64..1f7ac15 100644 --- a/src/commands/info/pronouns.ts +++ b/src/commands/info/pronouns.ts @@ -29,7 +29,7 @@ export const pronounMapping = { export type pronounsType = keyof typeof pronounMapping; export default class PronounsCommand extends BushCommand { - constructor() { + public constructor() { super('pronouns', { aliases: ['pronouns', 'pronoun'], category: 'info', diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts index 9df1c2a..29dc8a6 100644 --- a/src/commands/moderation/ban.ts +++ b/src/commands/moderation/ban.ts @@ -14,7 +14,7 @@ import { Ban, Guild, ModLog, ModLogType } from '../../lib/models'; const durationRegex = /(?:(\d+)(d(?:ays?)?|h(?:ours?|rs?)?|m(?:inutes?|ins?)?|mo(?:nths?)?|w(?:eeks?|ks?)?)(?: |$))/g; */ export default class BanCommand extends BushCommand { - constructor() { + public constructor() { super('ban', { aliases: ['ban'], category: 'moderation', diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts index a666c8e..09d6abf 100644 --- a/src/commands/moderation/kick.ts +++ b/src/commands/moderation/kick.ts @@ -4,7 +4,7 @@ import { BushSlashMessage } from '../../lib/extensions/discord-akairo/BushSlashM import { Guild, ModLog, ModLogType } from '../../lib/models'; export default class KickCommand extends BushCommand { - constructor() { + public constructor() { super('kick', { aliases: ['kick'], category: 'moderation', diff --git a/src/commands/moderation/modlog.ts b/src/commands/moderation/modlog.ts index 27018f1..d094885 100644 --- a/src/commands/moderation/modlog.ts +++ b/src/commands/moderation/modlog.ts @@ -6,7 +6,7 @@ import { BushCommand } from '../../lib/extensions/discord-akairo/BushCommand'; import { ModLog } from '../../lib/models'; export default class ModlogCommand extends BushCommand { - constructor() { + public constructor() { super('modlog', { aliases: ['modlog', 'modlogs'], category: 'moderation', diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts index 88fcc69..3496489 100644 --- a/src/commands/moderation/mute.ts +++ b/src/commands/moderation/mute.ts @@ -5,7 +5,7 @@ import { BushCommand } from '../../lib/extensions/discord-akairo/BushCommand'; import { Guild, ModLog, ModLogType, Mute } from '../../lib/models'; export default class MuteCommand extends BushCommand { - constructor() { + public constructor() { super('mute', { aliases: ['mute'], category: 'moderation', diff --git a/src/commands/moderation/role.ts b/src/commands/moderation/role.ts index d1f8e00..71bb88e 100644 --- a/src/commands/moderation/role.ts +++ b/src/commands/moderation/role.ts @@ -24,7 +24,7 @@ export default class RoleCommand extends BushCommand { 'Giveaway (5m)': ['*', 'Admin Perms', 'Sr. Moderator', 'Moderator'], 'Giveaway (1m)': ['*', 'Admin Perms', 'Sr. Moderator', 'Moderator'] }; - constructor() { + public constructor() { super('role', { aliases: ['role', 'addrole', 'removerole'], category: 'moderation', diff --git a/src/commands/moulberry-bush/giveawayPing.ts b/src/commands/moulberry-bush/giveawayPing.ts index 40f782d..dbbbfef 100644 --- a/src/commands/moulberry-bush/giveawayPing.ts +++ b/src/commands/moulberry-bush/giveawayPing.ts @@ -3,7 +3,7 @@ import { BushMessage } from '../../lib/extensions/discord.js/BushMessage'; import AllowedMentions from '../../lib/utils/AllowedMentions'; export default class GiveawayPingCommand extends BushCommand { - constructor() { + public constructor() { super('giveawayping', { aliases: ['giveawayping', 'giveawaypong'], category: "Moulberry's Bush", diff --git a/src/commands/moulberry-bush/level.ts b/src/commands/moulberry-bush/level.ts index c81c555..eabf7a0 100644 --- a/src/commands/moulberry-bush/level.ts +++ b/src/commands/moulberry-bush/level.ts @@ -11,7 +11,7 @@ import { CanvasProgressBar } from '../../lib/extensions/Util'; */ export default class LevelCommand extends BushCommand { - constructor() { + public constructor() { super('level', { aliases: ['level', 'rank'], category: "Moulberry's Bush", |