Build a Twitch.tv Chat Bot in 10 Minutes with Node.js – Tutorial



Download Node.js – https://nodejs.org/en/
Node.js Tutorial – https://youtu.be/Do_Hsb_Hs3c
Tmi.js Documentation – https://www.tmijs.org/
Generate OAuth Token – http://twitchapps.com/tmi/

Follow me on Twitter for updates! @dev_coffee or https://twitter.com/dev_coffee

source

36 comments

  • NightBorn 3 years ago

    Anybody know how to fix the err:

    var client = new tmi.client(options)
    ^

    TypeError: tmi.client is not a constructor
    at Object.<anonymous> (/Users/WolvenOne/Desktop/TwitchBot/server.js:18:14)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:393:7)
    at startup (bootstrap_node.js:150:9)
    at bootstrap_node.js:508:3

    Reply
  • bentozaful 3 years ago

    I cant get past https://youtu.be/K6N9dSMb7sM?t=383
    i have the exact same code in my app.js file (with my personal api-key and username) and i get the error:
    "error: Improperly formatted auth" 🙁

    Reply
  • BaHeTo0 3 years ago

    how can i get the time since i went live until the point i write a command? I want to make that !uptime command that shows it.

    Reply
  • Andrea Biaggi 3 years ago

    Is there a version of TMI but for Java?

    Reply
  • Juan Jimenez 3 years ago

    This is awesome! thank you ! haha straight outta cookies 😀

    Reply
  • Chaaos2 3 years ago

    Great video mang.. exactly what i was looking for when i googled "build a twitch bot with javascript"

    Reply
  • AvatarLand Razer 3 years ago

    updated versions with more advanced stuff? like ban commands, points, etc?

    Reply
  • Colinsnoey7 3 years ago

    To start off I am not thte best at this. But I was wondering if there is ever going to be a part 2 with the bot automatically timing people out or banning people. With subscriber messages, cheers messages. With automatic messages and stuff like this. Since this is not my strong suit, I would love to a follow up. Or if anyone is able to help me with writing these commands 🙂

    Reply
  • Diana Carrier 3 years ago

    Awesome tutorial! Also your keyboard sounds amazing and I want it!

    Reply
  • Pete Robie 3 years ago

    Any plans on a follow up to this? Maybe hooking it up to mLab instead of hard coding everything. Good work.

    Reply
  • Andrew Snider 3 years ago

    keeps on coming back with tmi.client is not a constructor. any ideas on how to fix that?

    Reply
  • Jackson Stone 3 years ago

    I have that same straight outta cookies shirt

    Reply
  • juicemna1 3 years ago

    this is a great tutorial btw!

    Reply
  • juicemna1 3 years ago

    can you show a vid on how to make HTTP 'POST' from twitch api

    Reply
  • Klatuu82 3 years ago

    Hi, nice Vid, this get me started with node.js

    Now my Q: how to run in on server, can anyone show me this.

    Reply
  • youreMine - Hendrik 3 years ago

    Text Editor Name?

    Reply
  • juicemna1 3 years ago

    how you make the console.log code part appear in the command prompt? It's not appearing for me

    Reply
  • Diego Ochoa Maldonado 3 years ago

    thanks for the video bro. helped a lot

    Reply
  • juicemna1 3 years ago

    this part of the code doesn't appear on the console……. client.on('connected', function(address, port) {
    console.log("Address: " + address + " Port: " + port);
    }); I'm not sure if it's because of the version of Sublime, but it doesn't appear on the console at all, but the connection works

    Reply
  • juicemna1 3 years ago

    I'm confused as to how he ran the code. Where do you find that thing at the bottom right of the video? How do you get to it?

    Reply
  • Semagdad 3 years ago

    Your awesome man

    Reply
  • An Idiot's Guide 3 years ago

    For some reason I'm getting "tmi.client is not a constructor" error when trying to make the client.

    Reply
  • Shubham Jain 3 years ago

    Dude this video is so awesome just like your other videos. Please keep adding some more stuff. Cheers!

    Reply
  • Tre Babcock 3 years ago

    Thanks man. Gave me all the information I needed to get started.

    Reply
  • Luculent - 3 years ago

    Thanks this has really helped me get started. If you make another one a simple loyalty system demo would be a nice touch

    Reply
  • Wiktor Zralka 3 years ago

    When will you make another video about twitch bot?

    Reply
  • Jed Padilla 3 years ago

    Maybe this is a stupid question so sorry in advance.

    Once I have this all working. Is it possible to take the app.js and host it on a webserver so that I can have it running at all times and not just from my pc?

    Reply
  • Supermansbrother 3 years ago

    +Dev Coffee this is an awesome video thanks for making it! I was wondering if you could take a look at my code and tell me what's going wrong.

    I'm trying to make a bot that auto-bans a certain username whenever they join my channel, however currently it executes whenever anyone joins the channel.

    heres the hastebin link to my code

    http://hastebin.com/xaziteliha.php

    Reply
  • foetee 3 years ago

    You are awesome at explaining things. Good work man.

    Reply
  • Christopher Atwater 3 years ago

    this is a great tutorial! please add coding support for manipulating stream currency through secondary bots like ankhbot.

    Reply
  • Yoshii 3 years ago

    If you want to do simple testing and are currently offline, you could always do this to go to just your Twitch chat without actually loading your channel:

    http://www.twitch.tv/YOUR USERNAME HERE/chat

    Reply
  • TE4L 3 years ago

    Why is js way faster at connection to an IRC than PHP?

    Reply
  • Chris Gates 3 years ago

    will the generated oauth token expire?

    Reply
  • AidanOleary92 3 years ago

    Awesome video

    Reply
  • DICE HELIX 3 years ago

    helix_on_twitch Hook me up when im online, too much tech for me. good job kboqing it though

    Reply
  • qwe 2 years ago

    if you run into “tmi.client is not a constructor” then you probably installed the wrong package. “npm i tmi.js –save” is how you install

    Reply

Add your comment

Your email address will not be published.