mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 13:53:12 +02:00
37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
const { Command } = require('discord.js-commando');
|
|
const zalgo = require('zalgolize');
|
|
|
|
module.exports = class ZalgoCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'zalgo',
|
|
group: 'textedit',
|
|
memberName: 'zalgo',
|
|
description: 'Zalgoizes Text (x;zalgo This Text)',
|
|
examples: ['x;zalgo This Text'],
|
|
args: [{
|
|
key: 'text',
|
|
prompt: 'What text would you like to convert to zalgo?',
|
|
type: 'string',
|
|
validate: content => {
|
|
if (content.length < 500) {
|
|
return true;
|
|
}
|
|
return `Please keep your text under 500 characters, you have ${content.length}.`;
|
|
},
|
|
parse: text => {
|
|
return zalgo(text);
|
|
}
|
|
}]
|
|
});
|
|
}
|
|
|
|
run(message, args) {
|
|
if (message.channel.type !== 'dm') {
|
|
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
|
}
|
|
const { text } = args;
|
|
return message.say(`\u180E${text}`);
|
|
}
|
|
};
|