mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
const commando = require('discord.js-commando');
|
|
const zalgo = require('zalgolize');
|
|
|
|
module.exports = class ZalgoCommand extends commando.Command {
|
|
constructor(Client) {
|
|
super(Client, {
|
|
name: 'zalgo',
|
|
group: 'textedit',
|
|
memberName: 'zalgo',
|
|
description: 'Zalgoizes Text (;zalgo This Text)',
|
|
examples: [';zalgo This Text'],
|
|
args: [{
|
|
key: 'text',
|
|
prompt: 'What text would you like to convert to zalgo?',
|
|
type: 'string',
|
|
validate: content => {
|
|
if (zalgo(content).length > 1950) {
|
|
return 'Your message content is too long.';
|
|
}
|
|
return true;
|
|
}
|
|
}]
|
|
});
|
|
}
|
|
|
|
run(message, args) {
|
|
if (message.channel.type !== 'dm') {
|
|
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
|
}
|
|
console.log(`[Command] ${message.content}`);
|
|
const zalgoified = zalgo(args.text);
|
|
return message.say(zalgoified);
|
|
}
|
|
};
|