Twitch Chat Bot Tutorial - Create & Deploy with node.js, tmi.js, & Heroku

preview_player
Показать описание
- Parsing Twitch chat messages for commands

🧐 What's Inside
00:00 Intro to Creating a Twitch Chat Bot
00:30 What tools will we use?
04:50 Testing the chat app on a Twitch stream
08:45 Using environment variables with dotenv to store sensitive data
10:34 Sending a response to a Twitch chat from a bot user
12:10 Listening for and parsing chat commands with regexp
15:25 Creating a map of responses to respond to commands with
19:01 Deploying the Twitch chat bot to Heroku
22:18 Adding a Procfile and configuring a Heroku worker dyno
23:50 Testing the deployed Twitch chat bot
24:48 Outro

🗒️ Read More

🔔 Subscribe for more tech and developer videos

🐦 Get updates straight to your Twitter @colbyfayock

📸 Catch the next stream live on Twitch @colbyfayock

✉️ Or a newsletter right to your inbox!

💝 Sponsor me for more free content like this!

🎥 Want to know what A/V equipment I use?

🧰 More Resources

Heroku

🎼 Music

Music from Uppbeat (free for Creators!):
License code: XS1OLTHIOZ86SRIS

#colbyfayock #twitchbot #nodejs #heroku #twitch #twitchchat #webdevelopment
Комментарии
Автор

Your explanations are so calm and clear. Very easy to follow and very nice to listen to man!

theminehamster
Автор

I just built my basic chatbot! Thank you. Your tutorial has set me off in the right direction to build a more personalized bot and a chance to practice code.

zombiekookie
Автор

Your videos have so much production quality... I can't wait til more people notice you!

ryanhuellen
Автор

const [raw, command, argument] = message.match(regexpCommand);

TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))
it gives this error can you help me

Utab
Автор

Awesome video!

That gaming stream looked like a ton of fun. Needed more cannons, though.

TrostCodes
Автор

Hey Colby! Great work and thanks for the video.

I was able to get a basic bot up and running but as I'm abstracting it up I need to do some AJAX calls to a remote web server where some API functionality is housed that I want my bot to take advantage of.

Normally you'd do a .ajax call in vanilla JS but have you had any luck abstracting AJAX calls to external web servers/endpoint through Node? And if so could you key me in to how I might do that in the server.js file you built in this tutorial?

I've included JQuery via NPM and maybe it's just the end of the week and I'm not seeing where or how to do these calls. Does Node have a different syntax for doing AJAX calls inside the server file?

Thanks in advance!

AisDrew
Автор

Have you considering making a twitch bot that uses ChatGTP?
Now that could be some fun interactions.
Especially if you are able to preload character prompts.

CaliMeatWagon
Автор

What do you think about running this bot client-side from some website that temporarily monitors a chat? Would that be possible / safe?

reecelong
Автор

I know this is a longshot being an older video but im trying to get the bot to reply in a manner such as this "$(user) has high-fived ${random.chatter}" with $(user) being the person who typed !highfive and $(random.chatter) being a random user from the viewer list. Does anyone know of a simple way of making that work?

Robssuttie
Автор

you could just use
if (self) return;
to detect if its coming from the bot, dont need that whole isNotBot line.

PnKllr
Автор

do you by chance take on small custom programming jobs? i have quite a few things on my head i want done and been trying to figure out how to program it to no avail : (

cherieann
Автор

Hi Colby !
Thanks for your vid !
But the part with ${message} and ${tags.username} dont work for me, how can I fix that ?

(Sorry for my English, I dont speak currently English 😅)

itsmeee
Автор

Not sure if you still look through these comments, but the site that you used to generate an oauth code says they're for testing purposes only. Unfortunately Twitch documentation is ridiculously opaque on generating an ouath code for applications/bots. Do you have a video for this flow? Did you permanently use one of their code?

RuneMason
Автор

Thanks, very useful. I deployed my bot. The only part that I don't like is the command matching. If you tipe eg. 1 in twitch chat, the program throws an error

yumemmo
Автор

Hi, thanks for the video. However, you don't talk about the bot being disconnected if you do not answer to the PING requests from Twitch. How do you handle that?

chalas
Автор

Hey i dont know if you will still react since this video is from about a year ago. Is it just possible running a "worker: npm start" without using heroku, so that it just runs as long our pc is on?

hades
Автор

For some reason the bot shuts itself down when i write a message that doesn't contain any commands, also, if i move the .env file into the node module into a gitignore file, will server.js still be able to use the libraries commands? Isn't that kinda like changing the file directory?

matteomangani
Автор

So when I followed your thing when ever I typed anything that wasn't a command it just stopped my bot from working and if was a word like hello where I have a function going off it gives me this long little error message but keeps the bot running until something not accounted for comes through. any thoughts on why that is happening?

awsomebudderbrogaming
Автор

Hey Team, let's have a beer after this!

eleah
Автор

So that display-name flags as deprecated, I've seen it on 2 tutorials for this?

junglejon
join shbcf.ru