Hi all, sorry if this isn’t 100% relevant to the topic, but I’m not sure where to put this. So after a lot of trial and error, and wanting to scream while figuring out OAuth, I finally got a bot working using my own generated access token that’s not just from a toekn generating website. However, whenever I send even just one message the bot or server or whatever seems to overload and quit, with the error “Maximum call stack exceeded.” I’m not really sure what the problem is, so I was wondering if there was a common answer, or something obvious in this code:
const tmi = require('tmi.js');
require('dotenv').config();
const client = new tmi.Client({
connection: {
reconnect: true
},
channels: [ process.env.TARGET_CHANNEL ],
identity: {
username: process.env.USERNAME,
password: process.env.ACCESS_TOKEN
},
});
client.connect();
client.on('message', (channel, tags, message, self) => {
const isNotBot = tags.username.toLowerCase() !== process.env.USERNAME;
if (!isNotBot) return;
if (isNotBot) {
client.say(channel, `Message "${message}" was sent by ${tags.username}`)
}
console.log(`${tags['display-name']}: ${message}`);
});