Text to Speech Twitch Bot : How to by Navetz

Click here to find the YouTube Video if it doesn’t load above.

Follow these easy steps to build a text to speech twitch bot:

  1. Install Node.js
  2. Create a text-to-speech directory for your bot.
  3. Open a Node Command Prompt and type cd text-to-speech.
  4. Type npm init and click enter until it’s configured.
  5. Type npm install say followed by npm install tmi.js
  6. Get your auth password for tmi.js. Make sure you’re logged in with your bot account. Oh btw you need a bot account.
  7. Open Sublime text editor and safe a new file called index.js inside of your text-to-speech directory.
  8. Paste the following code and replace your password with yours.
			var tmi = require('tmi.js');
			var say = require('say');

			var options = {
				options: {
					debug: false
				connection: {
					cluster: "aws",
					reconnect: true
				identity: {
					username: "bhosbot",
					password: ""
				channels: ["navetz"]

			var client = new tmi.client(options);

			client.on("chat", function (channel, userstate, message, self) {
				say.speak(userstate.username + " says " + message);


That’s it, you now have a basic text to speech twitch bot! I’m sure a lot of you will find fun ways to extend the functionality!

If you enjoyed please subscribe on YouTube, leave comments, and come check out my twitch channel if you’re into Dota 2!