Chat user metadata lifetime/handling (USERCOLOR, SPECIALUSER, EMOTESET...)

So, I’m working on my tmi client again and I’ve got some questions about the metadata that is received when using TWITCHCLIENT 3

What messages are always resent before a chat message, and which are only sent once/on occasion?

From what I can discern, the commands SPECIALUSER (for subscribers and turbo), USERCOLOR and EMOTESET will be sent just before each and every new message.
SPECIALUSER for other flags, such as admin and staff, at the other hand, seem to be sent at other occasions (upon entering a channel, maybe upon them entering the channel?)

(+o and -o are slightly more predictable (as they sort of need to comply with actual IRC standards))

Does anyone have a good idea of what data is safe to discard after a message (since it will come again each new message), and which data will not necessarily be sent before each new message, and such needs to be saved for a longer time?

I would like to use the data in my application but I would like to avoid saving/overwriting to a large and growing dataset, in case my application runs on an active channel with lots of different users flowing through for many hours.

I’m guessing a lot of this will be moot once IRCv3 comes out, so I might just save it all forever in memory for the time being, and make an efficient solution later. But there still haven’t been much word on that so I thought I’d implement the current version for now.

I’d personally recommend just waiting for IRCv3. An early version is already live if you send the correct CAP request:
CAP REQ :twitch.tv/tags

And you’ll start getting tags similar to this on each message:

@color=#0000FF;emotes=16156:0-7;subscriber=1;turbo=0;user_type=mod :joe_user!joe_user@joe_user.tmi.twitch.tv PRIVMSG #somerandomchannel:lirikMLG is awesome!

Valid user types currently appear to be: staff, admin, global_mod, mod and no value. Broadcasters are either no value or mod depending on whether they modded themselves in their channel.

Keep in mind this is still really early and subject to unannounced changes. I’d recommend checking out #twitch-api on Freenode for more early tidbits about IRCv3.

1 Like

I just after posting this message tried doing IRCv3 capability negotiation, and saw that I now got a response when using CAP REQ, instead of invalid command. But I couldn’t find out what request to use.
I will look into this and probably join #twitch-api tomorrow.

The modules I’m using doesn’t support IRCv3 nor are there other IRCv3 complete modules for nodejs.

Is there a way they can make “TWITCHCLIENT 4” but with emote ids, emote positions and all that other stuff?

It would be more useful for me.

Chat will still work without IRCv3 support, because the protocol is backwards-compatible. You will not get any of the new metadata. Additionally, when IRCv3 support is officially released we will deprecate TWITCHCLIENT and give developers several months of warning to update their scripts/bots to support the new protocol.

Thanks for putting that more clearly, that puts my mind at ease.

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