mrmBot-Matrix/commands/general/decode.js

16 lines
584 B
JavaScript
Raw Normal View History

const { clean } = require("../../utils/misc.js");
const Command = require("../../classes/command.js");
class DecodeCommand extends Command {
async run() {
if (this.args.length === 0) return `${this.message.author.mention}, you need to provide a string to decode!`;
const b64Decoded = Buffer.from(this.args.join(" "), "base64").toString("utf-8");
return `\`\`\`\n${await clean(b64Decoded)}\`\`\``;
}
static description = "Decodes a Base64 string";
static aliases = ["b64decode", "base64decode"];
static arguments = ["[text]"];
}
module.exports = DecodeCommand;