mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-16 00:12:32 +02:00
Emojify Command
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { letterTrans } = require('custom-translate');
|
||||
const dictionary = require('../../assets/json/emojify');
|
||||
|
||||
module.exports = class EmojifyCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'emojify',
|
||||
aliases: ['regional-indicator'],
|
||||
group: 'text-edit',
|
||||
memberName: 'emojify',
|
||||
description: 'Converts text to emoji form.',
|
||||
args: [
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to emoji?',
|
||||
type: 'string',
|
||||
validate: text => {
|
||||
if (letterTrans(text, dictionary).length < 2000) return true;
|
||||
return 'Your text is too long.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return msg.say(letterTrans(text.toLowerCase(), dictionary));
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user