mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-09 18:39:35 +02:00
More uniform group names
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class URLEncodeCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'url-encode',
|
||||
aliases: ['encode-url', 'encode-uri', 'uri-encode', 'encode-uri-component'],
|
||||
group: 'edit-text',
|
||||
memberName: 'url-encode',
|
||||
description: 'Encodes text to URL-friendly characters.',
|
||||
args: [
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to encode?',
|
||||
type: 'string',
|
||||
validate: text => {
|
||||
if (encodeURIComponent(text).length < 2000) return true;
|
||||
return 'Invalid text, your text is too long.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { text }) {
|
||||
return msg.say(encodeURIComponent(text));
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user