Decode HTML Command

This commit is contained in:
Dragon Fire
2021-03-18 16:58:07 -04:00
parent 490ef77fef
commit c6e3c9c66e
2 changed files with 30 additions and 1 deletions
+29
View File
@@ -0,0 +1,29 @@
const Command = require('../../structures/Command');
const { decode: decodeHTML } = require('html-entities');
module.exports = class HtmlDecodeCommand extends Command {
constructor(client) {
super(client, {
name: 'html-decode',
aliases: ['decode-html'],
group: 'edit-text',
memberName: 'html-decode',
description: 'Decodes HTML characters to regular characters.',
args: [
{
key: 'text',
prompt: 'What text would you like to decode?',
type: 'string',
validate: text => {
if (decodeHTML(text).length < 2000) return true;
return 'Invalid text, your text is too long.';
}
}
]
});
}
run(msg, { text }) {
return msg.say(decodeHTML(text));
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "132.7.0",
"version": "132.8.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {