discord-tts-spanish

2.2.3 • Public • Published

discord-tts

Node.js module to make your discord bot talk

Quick Example

const secret = require("./secret.json"); //file with your bot credentials/token/etc
const discord = require("discord.js");
const discordTTS=require("discord-tts-spanish");
const client = new discord.Client();
client.login(secret.token);

client.on("ready",()=>{
    console.log("Online");
});

client.on("message",msg=>{
    if(msg.content==="say test 123"){
        const broadcast = client.voice.createBroadcast();
        var channelId=msg.member.voice.channelID;
        var channel=client.channels.cache.get(channelId);
        channel.join().then(connection => {
            broadcast.play(discordTTS.getVoiceStream("test 123"));
            const dispatcher=connection.play(broadcast);
        });
    }
});

Tested working with:

OS Windows 10
Node.js v12.16.1
discord.js v^12.2.0
@discordjs/opus: github:discordjs/opus,
ffmpeg v0.0.4
ffmpeg-static v4.2.7
opusscript v0.0.7

Contributing

$ git clone https://github.com/u0f/tts.git
$ npm install

Make a pull request with your changes
Contributions, features request or any other kind of help are very welcome :)

License

MIT

Package Sidebar

Install

npm i discord-tts-spanish

Weekly Downloads

7

Version

2.2.3

License

MIT

Unpacked Size

5.38 kB

Total Files

4

Last publish

Collaborators

  • retr0s