Haha-Yes/commands/general/emotesay.js

44 lines
1,004 B
JavaScript
Raw Permalink Normal View History

2018-12-30 01:20:24 +01:00
const { Command } = require('discord-akairo');
const emojiCharacters = require('../../emojiCharacters');
2019-02-08 19:06:23 +01:00
const rand = require('../../rand.js');
2018-12-30 01:20:24 +01:00
class EmotesayCommand extends Command {
2019-01-02 08:09:45 +01:00
constructor() {
super('emotesay', {
aliases: ['emotesay', 'esay'],
category: 'general',
2019-11-09 12:04:01 +01:00
clientPermissions: ['SEND_MESSAGES'],
2019-01-02 08:09:45 +01:00
args: [
{
id: 'text',
2019-01-10 20:45:29 +01:00
type: 'string',
2019-06-23 03:41:59 +02:00
prompt: {
start: 'Write something so i can replace the space with dancing emote',
},
2019-01-10 20:45:29 +01:00
match: 'rest'
2019-01-02 08:09:45 +01:00
}
],
description: {
2018-12-30 01:20:24 +01:00
content: 'Replace the text you send with dancing letters',
usage: '[text]',
examples: ['Hello']
}
2019-01-02 08:09:45 +01:00
});
}
2018-12-30 01:20:24 +01:00
2019-01-02 08:09:45 +01:00
async exec(message, args) {
let text = args.text;
2019-01-02 18:45:53 +01:00
if (!text)
return;
2019-02-08 19:06:23 +01:00
text = rand.random(text, message);
2019-01-02 08:09:45 +01:00
message.delete();
let emojiArray = [];
for (let i = 0; i < text.length; i++)
emojiArray[i] = emojiCharacters[text.toLowerCase().split('')[i]];
message.channel.send(emojiArray.join(''));
}
2018-12-30 01:20:24 +01:00
}
module.exports = EmotesayCommand;