Hi! I have recently started a coding project where my bot does a countdown in the channels chat when the command is given. This bot used to work perfectly, but then literally stopped working. I have seen a few similar posts about this. The bot is connected to the channels chat because in PowerShell its shows that its connected. But nothing happens in the actual chat. Then if I proceed to input the command in the chat, then in my console everything happens (like it should), but for some reason no response on the actual chat.
I then (from curiosity) tried connected the bot to its own channel. And… it worked. And I am completely confused on why it’s not working on my main channel and how it only works on it’s own channel.
Similar Post: Bot can receive messages, but sent messages do not show up in chat
index.js:
const tmi = require('tmi.js');
const channel = 'yashk_'
const options = {
options: {
debug: true,
},
connection: {
cluster: 'aws',
reconnect: true,
},
identity: {
username: 'countdownscrimbot',
password:
},
channels: [channel],
},
client = new tmi.client(options);
function sleep(ms){
return new Promise(resolve=>{
setTimeout(resolve,ms)
})
}
async function countdown() {
client.action(channel, 'READY UP ON THE WORDS "GO"');
await sleep(3000);
client.action(channel, 'GAME STARTING IN...');
await sleep(1050);
client.action(channel, '10');
await sleep(1050);
client.action(channel, '9');
await sleep(1050);
client.action(channel, '8');
await sleep(1050);
client.action(channel, '7');
await sleep(1050);
client.action(channel, '6');
await sleep(1050);
client.action(channel, '5');
await sleep(1050);
client.action(channel, '4');
await sleep(1050);
client.action(channel, '3');
await sleep(1050);
client.action(channel, '2');
await sleep(1050);
client.action(channel, '1');
await sleep(1050);
client.action(channel, 'GO');
}
client.connect();
client.on('connected', (address, port)=> {
client.action(channel, 'Server Status: NAE Online');
});
client.on('chat', (channel, user, message, self) => {
if (message === '!startgame') {
countdown();
}
});
[ ](http://)
