From 5b3b5d0611ce543d19749529a41fad314cde96ae Mon Sep 17 00:00:00 2001 From: WatDuhHekBro <44940783+WatDuhHekBro@users.noreply.github.com> Date: Tue, 15 Dec 2020 17:29:40 -0600 Subject: [PATCH] Added some eco aliases and fixed eval command --- src/commands/admin.ts | 9 +++++---- src/commands/fun/subcommands/eco-core.ts | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/commands/admin.ts b/src/commands/admin.ts index 645b1fc..47279f9 100644 --- a/src/commands/admin.ts +++ b/src/commands/admin.ts @@ -139,15 +139,16 @@ export default new Command({ description: "Evaluate code.", usage: "", permission: Command.PERMISSIONS.BOT_OWNER, - async run($: CommonLibrary): Promise { + // You have to bring everything into scope to use them. AFAIK, there isn't a more maintainable way to do this, but at least TS will let you know if anything gets removed. + async run({args, author, channel, client, guild, member, message}): Promise { try { - const code = $.args.join(" "); + const code = args.join(" "); let evaled = eval(code); if (typeof evaled !== "string") evaled = require("util").inspect(evaled); - $.channel.send(clean(evaled), {code: "x1"}); + channel.send(clean(evaled), {code: "js", split: true}); } catch (err) { - $.channel.send(`\`ERROR\` \`\`\`x1\n${clean(err)}\n\`\`\``); + channel.send(`\`ERROR\` \`\`\`js\n${clean(err)}\n\`\`\``); } } }), diff --git a/src/commands/fun/subcommands/eco-core.ts b/src/commands/fun/subcommands/eco-core.ts index 38d1725..8aa4726 100644 --- a/src/commands/fun/subcommands/eco-core.ts +++ b/src/commands/fun/subcommands/eco-core.ts @@ -5,6 +5,7 @@ import {isAuthorized, getMoneyEmbed, getSendEmbed, ECO_EMBED_COLOR} from "./eco- export const DailyCommand = new Command({ description: "Pick up your daily Mons. The cooldown is per user and every 22 hours to allow for some leeway.", + aliases: ["get"], async run({author, channel, guild}) { if (isAuthorized(guild, channel)) { const user = Storage.getUser(author.id); @@ -75,6 +76,7 @@ export const GuildCommand = new Command({ export const LeaderboardCommand = new Command({ description: "See the richest players.", + aliases: ["top"], async run({guild, channel, client}) { if (isAuthorized(guild, channel)) { const users = Storage.users;