URL Decode Command

This commit is contained in:
Dragon Fire
2019-07-17 13:55:04 -04:00
parent 97f886693f
commit 2f55ceff2c
3 changed files with 31 additions and 2 deletions
+28
View File
@@ -0,0 +1,28 @@
const Command = require('../../structures/Command');
module.exports = class URLDecodeCommand extends Command {
constructor(client) {
super(client, {
name: 'url-decode',
aliases: ['decode-url', 'decode-uri', 'uri-decode', 'decode-uri-component'],
group: 'text-edit',
memberName: 'url-decode',
description: 'Decodes URL characters to regular characters.',
args: [
{
key: 'text',
prompt: 'What text would you like to decode?',
type: 'string',
validate: text => {
if (decodeURIComponent(text).length < 2000) return true;
return 'Invalid text, your text is too long.';
}
}
]
});
}
run(msg, { text }) {
return msg.say(decodeURIComponent(text));
}
};