mrmBot-Matrix/commands/decode.js

12 lines
465 B
JavaScript
Raw Normal View History

2020-12-30 04:26:45 +00:00
const { clean } = require("../utils/misc.js");
2019-09-13 20:02:41 +00:00
exports.run = async (message, args) => {
if (args.length === 0) return `${message.author.mention}, you need to provide a string to decode!`;
2019-09-13 20:02:41 +00:00
const b64Decoded = Buffer.from(args.join(" "), "base64").toString("utf-8");
2020-12-30 04:26:45 +00:00
return `\`\`\`\n${await clean(b64Decoded)}\`\`\``;
2019-09-13 20:02:41 +00:00
};
exports.aliases = ["b64decode", "base64decode"];
exports.category = 1;
exports.help = "Decodes a Base64 string";
exports.params = "[text]";