mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
31 lines
763 B
JavaScript
31 lines
763 B
JavaScript
const { Command } = require('discord.js-commando');
|
|
const { wordTrans } = require('custom-translate');
|
|
const dictionary = require('../../assets/json/pirate');
|
|
|
|
module.exports = class PirateCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'pirate',
|
|
aliases: ['pirate-speak'],
|
|
group: 'text-edit',
|
|
memberName: 'pirate',
|
|
description: 'Converts text to pirate.',
|
|
args: [
|
|
{
|
|
key: 'text',
|
|
prompt: 'What text would you like to convert to pirate?',
|
|
type: 'string',
|
|
validate: text => {
|
|
if (wordTrans(text, dictionary).length < 2000) return true;
|
|
return 'Invalid text, your text is too long.';
|
|
}
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
run(msg, { text }) {
|
|
return msg.say(wordTrans(text, dictionary));
|
|
}
|
|
};
|