Hello Twitch World!
I’ve written a chatbot using node.js and tmi.js. Everything runs smoothly, but using the bot causes my internet connection to slow down and become unstable for days to come. At first I thought it a coincidence but the same phenomenon happened after each usage of the bot. The bot is not running, I restarted my pc and router repeatedly but still my normally strong internet connection becomes fragile.
I’ve monitored the amount of data upload and download during the run of the bot. It’s a bit higher than usual of course but nothing drastic.
Has anyone encountered a similar problem before? I’m at my wits end, none of the tutorials mention that phenomenon. I’d appreciate any thoughts on the matter!
Here is a minimal version of my code, it’s exactly as seen in the countless tutorials on the internet:
const tmi = require('tmi.js');
const client = new tmi.Client(
{
options:
{
debug: true
},
connection:
{
secure: true,
reconnect: true
},
identity:
{
username: ‘’, //deleted for privacy reasons
password: ‘’ //deleted for privacy reasons
},
channels: [ ‘’ ] //deleted for privacy reasons
});
client.connect();
function fun1() {
//…
}
client.on(
‘message’, (channel, tags, message, self) =>
{
if(message.toLowerCase() === '!bot')
{
client.say(channel, `bot is online`);
}
}
);
<\code>