Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client.join() returning No response from Twitch. #342

Closed
luandunas opened this issue Jun 6, 2019 · 11 comments
Closed

client.join() returning No response from Twitch. #342

luandunas opened this issue Jun 6, 2019 · 11 comments
Labels

Comments

@luandunas
Copy link

luandunas commented Jun 6, 2019

My code

var channels = ['xqcow' ,'sattelizergames' ,'summit1g' ,'gaules' ,'jovirone' ,'elded' ,'scarra' ...]
var client = tmi.client({
    options: {debug: false},
    connection: {reconnect: true, secure: true},
    channels: ['dunaaas'],
    identity: {username: "username",password: "oauth"}
});

client.on('connected', function(address, port) {
    console.log("Address: " + address + " Port: " + port);
    console.log(`connected channels: ${client.getOptions().channels.length}`);
    b();
});

function b(){
    if(channels[0] != undefined){
    client.join(channels[0]).then(function(data) {
          console.log(data);
          channels.shift();
          b();
        }).catch(function(err) {console.log(err)});
    }
    else{
        
    }
}

Actual behaviour:
Returning error when try connect in many channels using client.join()

Expected behaviour:
Don't return No response from Twitch.

Error

No response from Twitch.

Server configuration

  • Operating system: Windows 7
  • Node version (if applicable): 10.15.3
  • NPM version (if applicable): 10.15.3
  • tmi.js version: 1.4.2
@AlcaDesign
Copy link
Member

You're probably joining too many channels in the allotted time. (20 commands per 30 seconds for normal accounts) Why not just use the auto-joiner? You already have 1 channel in the client option's channels array.

var client = tmi.client({
    ...
    channels: [
        'dunaaas','xqcow' ,'sattelizergames' ,'summit1g' ,'gaules' ,
        'jovirone' ,'elded' ,'scarra', ...
    ],
    ...
});

@luandunas
Copy link
Author

In this case i can't use auto-joiner. I tried use Settimeout with 5 seconds, but still return "No response from Twitch."

@instafluff
Copy link

Seeing this same issue here as well. It successfully joins the first several channels and then gets the "No response from Twitch" error for all others indefinitely.

@pierregoutheraud
Copy link

pierregoutheraud commented Oct 23, 2020

This comes from the fact that the join channel promise races against a delay

tmi.js/lib/commands.js

Lines 263 to 269 in 5925310

// Race the Promise against a delay..
var delay = this._getPromiseDelay();
_.promiseDelay(delay).then(() => {
if(!hasFulfilled) {
this.emit(eventName, "No response from Twitch.", channel);
}
});

(which is often set to 600ms) and when you join a lot of channels, the join command sometimes take more than 600ms so you get that "No response from Twitch" error.

@hey24sheep
Copy link

I am facing the same issue. I don't think this is fixed.

@OikoumE
Copy link

OikoumE commented Jan 5, 2022

i am suddenly facing this issue aswell when joining 20 channels

@FlockersDesign
Copy link

got the same problem and just joing one channel

const tmi = require('tmi.js');
const { channel } = require('tmi.js/lib/utils');
require('dotenv').config();

const options = {
options: { debug: true,},
connection: {
reconnect: true,
secure: true,
},
identity: {
username: process.env.USER_TOKEN,
password: process.env.AUTH_TOKEN
},
channels: [ process.env.CHANNEL_TOKEN ]
};

const client = new tmi.client(options);
client.connect();

@MidKnightXI
Copy link

So I'm getting the same error error: No response from Twitch. after the Executing command: JOIN #[channel] with only one twitch channel (mine).

Here's my config:

import { client } from 'tmi.js';

const opts = {
  identity: {
    username: process.env.BOT_USERNAME,
    password: process.env.BOT_OAUTH_TOKEN
  },
  channels: [
    process.env.CHANNEL_NAME
  ]
}

const cli = new client(opts);

cli.connect();

I've no clue of why it's not working so just gonna check the future comments of the issue

@FlockersDesign
Copy link

So I'm getting the same error error: No response from Twitch. after the Executing command: JOIN #[channel] with only one twitch channel (mine).

Here's my config:

import { client } from 'tmi.js';

const opts = {
  identity: {
    username: process.env.BOT_USERNAME,
    password: process.env.BOT_OAUTH_TOKEN
  },
  channels: [
    process.env.CHANNEL_NAME
  ]
}

const cli = new client(opts);

cli.connect();

I've no clue of why it's not working so just gonna check the future comments of the issue

change cli.connect(); to client.connect();

@MidKnightXI
Copy link

should I open a new issue for it ?

@DennisMinn
Copy link

DennisMinn commented Sep 16, 2023

This comes from the fact that the join channel promise races against a delay

tmi.js/lib/commands.js

Lines 263 to 269 in 5925310

// Race the Promise against a delay..
var delay = this._getPromiseDelay();
_.promiseDelay(delay).then(() => {
if(!hasFulfilled) {
this.emit(eventName, "No response from Twitch.", channel);
}
});

(which is often set to 600ms) and when you join a lot of channels, the join command sometimes take more than 600ms so you get that "No response from Twitch" error.

Is there a way to increase or remove the delay if we have a verified account? The auto-joiner isn't a good fit for my application because it is only scanning for live channels.
https://dev.twitch.tv/docs/irc/

Limit Description
20 messages per 30 seconds If the user isn’t the channel’s broadcaster or moderator, the bot may send a maximum of 20 messages per 30 seconds.
100 messages per 30 seconds If the user is the channel’s broadcaster or moderator, the bot may send a maximum of 100 messages per 30 seconds.
7,500 messages per 30 seconds The bot is limited to sending 7,500 messages per 30 seconds across all channels. This means that the bot could send 10 messages per 30 seconds to 750 different channels. However, it couldn’t, for example, send 7,500 messages per 30 seconds to a single channel because it would exceed the 20 messages per 30 second limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants