NAMES :Unknown Command

I’m getting NAMES: Unknown Command when trying to call: NAMES\r\n

I’m requesting capabilities:

client.write("CAP LS\r\n");
    // CAP * LS
client.write("CAP REQ\r\n"); 
    // CAP * ACK
client.write("CAP REQ\r\n"); 
    // CAP * ACK

I wait until I get these responses, then join my channel’s channel and run:

client.write("CAP LIST\r\n");
    // CAP * LIST
    // 421 <username> NAMES :Unknown command

Any ideas?

With the capability you will receive a NAMES event on channel join, and JOIN, PART and MODE events while in the channel. Requesting the userlist manually via the NAMES command is not supported.

Remember that the userlist is cached and can take it’s time to be received, these events are not instantaneous like they would be in regular IRC. On some channels with too many users you may not receive one at all (unless that changed).

Channels with over a thousand users will only list OPs.

I think I’ll try joining a larger channel. I was doing some testing with 2 accounts (my bot, and my main) and NAMES would only display a single name, ever. I’ll see if the on-join NAMES is more reliable with a larger group of people.

> 353 divisionsol = #divisionsol :divisionsol
> 366 divisionsol #divisionsol :End of /NAMES list

Thanks for your input. Push comes to shove, I’ll just do it all through JOIN and PART.

Your best bet is to use both.

Often when you connect/reconnect, the server thinks you still have the names is what I noticed, and won’t send them again.

Either way - sometimes I get a huge NAMES list, and sometimes it’s pretty empty and suddenly I get a huge list of joins. I think you’ll have to use both in the end.

I’ve seen that too where I suddenly get a huge list of JOINS from a channel. Does anyone know what causes this?

Names are not sent real time, they are batched by the Twitch server for channels with < 1000 people. Names are completely disabled in channels for > 1000, with the exception for things like OP

Is there a way to determine if a server has >1000 viewers through IRC without using the API. In other words, is there a way to tell that you have just been sent a list of moderators (or whatever it sends you) and not the full list of viewers?

Not the server, it’s based on the channel you’re in. A casual comparison would be to look at something like having more than 1000 users returned.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.