mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 15:57:47 +02:00
Voice-based morse
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const { letterTrans } = require('custom-translate');
|
||||
const dictionary = require('../../assets/json/morse');
|
||||
|
||||
module.exports = class MorseCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'morse',
|
||||
aliases: ['morse-code'],
|
||||
group: 'edit-text',
|
||||
memberName: 'morse',
|
||||
description: 'Converts text to morse code.',
|
||||
args: [
|
||||
{
|
||||
key: 'text',
|
||||
type: 'string',
|
||||
validate: text => {
|
||||
if (letterTrans(text.toLowerCase(), dictionary, ' ').length < 2000) return true;
|
||||
return 'Invalid text, your text is too long.';
|
||||
},
|
||||
parse: text => text.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { text }) {
|
||||
return msg.say(letterTrans(text, dictionary, ' '));
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user