This commit is contained in:
Loic Bersier 2018-12-08 02:05:18 +01:00
parent 1dec1f54ea
commit d0fcc8c101

32
commands/fun/tts.js Normal file
View file

@ -0,0 +1,32 @@
const { Command } = require('discord.js-commando');
const speak = require('simple-tts');
const SelfReloadJSON = require('self-reload-json');
module.exports = class BadMemeCommand extends Command {
constructor(client) {
super(client, {
name: 'tts',
group: 'fun',
memberName: 'tts',
description: `Return what you type in a tts file`,
ownerOnly: true,
args: [
{
key: 'text',
prompt: 'What do you want to be said',
type: 'string',
}
]
});
}
async run(message, { text }) {
let blacklistJson = new SelfReloadJSON('./json/blacklist.json');
if(blacklistJson[message.author.id])
return blacklist(blacklistJson[message.author.id] , message)
speak(text, {format:'mp3', filename:'./tts'});
message.say({files: ['./tts.mp3']})
}}