mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Decode HTML Command
This commit is contained in:
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "132.7.0",
|
||||
"version": "132.8.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user