From 7d63a30cb643069db33bf85f7a6328a5d6562588 Mon Sep 17 00:00:00 2001 From: Thomas Bowen <6600748+ttbowen@users.noreply.github.com> Date: Mon, 20 Nov 2023 23:00:54 +0000 Subject: [PATCH] Remove eval command --- README.md | 2 +- packages/mrwhale-commands/README.md | 1 - .../src/commands/admin/eval.ts | 44 ------------------- 3 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 packages/mrwhale-gamejolt/src/commands/admin/eval.ts diff --git a/README.md b/README.md index 49a85d6..7a1e274 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Mr. Whale has a lot of commands, with 6 main categories: - 🖨️ **Useful**: `calculator`, `translate`, `hastebin`, `wiki`, `advice` and `newyear`! - 🔧 **Utility**: `help`, `info`, `langs`, `whois` and **3** more! - 🎨 **Image** : `chocolatemilk`, `avatar`, `gun`, `avatarfusion` -- 👑 **Owner**: `eval`, `reload` and `cleverbot`! +- 👑 **Owner**: `reload` and `cleverbot`! - 🏆 **Level**: `rank`, `leaderboard` [See the full command list](https://www.mrwhale.io/commands) diff --git a/packages/mrwhale-commands/README.md b/packages/mrwhale-commands/README.md index 95866c6..9d27280 100644 --- a/packages/mrwhale-commands/README.md +++ b/packages/mrwhale-commands/README.md @@ -54,7 +54,6 @@ | Name | Description | Usage | | ------------- | ---------------------------------------- | -------------------- | | **cleverbot** | Toggle cleverbot on/off. | cleverbot | -| **eval** | Evaluate JavaScript code and execute it. | eval [code] | | **reload** | Reload a command. | reload [command|all] | ## License diff --git a/packages/mrwhale-gamejolt/src/commands/admin/eval.ts b/packages/mrwhale-gamejolt/src/commands/admin/eval.ts deleted file mode 100644 index d0a829e..0000000 --- a/packages/mrwhale-gamejolt/src/commands/admin/eval.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { Message } from "@mrwhale-io/gamejolt-client"; -import { codeBlock } from "@mrwhale-io/core"; - -import { GameJoltCommand } from "../../client/command/gamejolt-command"; - -import * as util from "util"; -import * as config from "../../../config.json"; - -export default class extends GameJoltCommand { - constructor() { - super({ - name: "eval", - description: "Evaluate JavaScript code and execute it.", - type: "admin", - usage: "eval ", - admin: true, - }); - } - - async action(message: Message, args: string[]): Promise { - const input = args.join(); - - if (!input) { - return message.reply("Please pass code to eval."); - } - - try { - let output = eval(input); - if (typeof output !== "string") { - output = util.inspect(output, { depth: 0 }); - } - - if (output.includes(config.frontend)) { - output = output.replace(config.frontend, "removed"); - } - - return message.reply(codeBlock(output, "js")); - } catch (error) { - return message.reply( - codeBlock(error.toString().replace(config.frontend, "removed")) - ); - } - } -}