mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
44 lines
957 B
JavaScript
44 lines
957 B
JavaScript
const Command = require('../../framework/Command');
|
|
const { wordTrans } = require('custom-translate');
|
|
const dictionary = require('../../assets/json/temmie');
|
|
|
|
module.exports = class TemmieCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'temmie',
|
|
aliases: ['temmie-speak'],
|
|
group: 'edit-text',
|
|
description: 'Converts text to Temmie speak.',
|
|
credit: [
|
|
{
|
|
name: 'UNDERTALE',
|
|
url: 'https://undertale.com/',
|
|
reason: 'Original Game'
|
|
}
|
|
],
|
|
args: [
|
|
{
|
|
key: 'text',
|
|
type: 'string',
|
|
validate: text => {
|
|
if (this.temmize(text).length < 2000) return true;
|
|
return 'Invalid text, your text is too long.';
|
|
}
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
run(msg, { text }) {
|
|
return msg.say(this.temmize(text));
|
|
}
|
|
|
|
temmize(text) {
|
|
return wordTrans(text, dictionary)
|
|
.replaceAll('ing', 'in')
|
|
.replaceAll('ING', 'IN')
|
|
.replaceAll('!', '!!!!111!1!')
|
|
.replaceAll('\'', '');
|
|
}
|
|
};
|