Files
xiao/commands/textedit/say.js
T
2017-04-20 13:48:12 +00:00

36 lines
1.2 KiB
JavaScript

const { Command } = require('discord.js-commando');
module.exports = class SayCommand extends Command {
constructor(client) {
super(client, {
name: 'say',
aliases: [
'copy',
'repeat',
'parrot',
'echo'
],
group: 'textedit',
memberName: 'say',
description: 'Make XiaoBot say what you wish. (x;say I can talk!)',
examples: ['x;say I can talk!'],
guildOnly: true,
args: [{
key: 'text',
prompt: 'What text would you like XiaoBot to say?',
type: 'string'
}]
});
}
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES')) return message.say(':x: Error! I don\'t have the Manage Messages Permission!');
}
const { text } = args;
message.delete();
return message.say(`\u180E${text}`);
}
};