Files
xiao/commands/textedit/cowsay.js
T
2017-04-12 17:48:02 +00:00

33 lines
1.2 KiB
JavaScript

const { Command } = require('discord.js-commando');
module.exports = class CowsayCommand extends Command {
constructor(client) {
super(client, {
name: 'cowsay',
group: 'textedit',
memberName: 'cowsay',
description: 'Converts text to cowsay. (;cowsay This text)',
examples: [';cowsay This text'],
args: [{
key: 'text',
prompt: 'What text would you like the cow to say?',
type: 'string',
validate: text => {
if (text.length < 1500) {
return true;
}
return 'Your message content is too long.';
}
}]
});
}
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
const text = args.text;
return message.code(null, `< ${text} >\n \\ ^__^\n \\ (oO)\\_______\n (__)\\ )\\/\\\n U ||----w |\n || ||`);
}
};