mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-04 07:46:43 +02:00
30 lines
962 B
JavaScript
30 lines
962 B
JavaScript
const { Command } = require('discord.js-commando');
|
|
|
|
module.exports = class ReverseCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'reverse',
|
|
group: 'textedit',
|
|
memberName: 'reverse',
|
|
description: 'Reverses text (x;reverse This text please)',
|
|
examples: ['x;reverse This text please'],
|
|
args: [{
|
|
key: 'text',
|
|
prompt: 'What text would you like to reverse?',
|
|
type: 'string',
|
|
parse: text => {
|
|
return text.split('').reverse().join('');
|
|
}
|
|
}]
|
|
});
|
|
}
|
|
|
|
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}`);
|
|
}
|
|
};
|