tmijs / tmi.js

💬 Javascript library for the Twitch Messaging Interface. (Twitch.tv)
https://tmijs.com
MIT License
1.54k stars 216 forks source link

Userstate object missing properties #476

Closed sslanec closed 3 years ago

sslanec commented 3 years ago

It appears that Twitch has added additional properties to the userstate object attached to messages, as some are missing when compared to messages sent through tmi.js. This includes the client-nonce, flags, id, room-id, turbo, and user-id properties.

From tmi.js:

badge-info: null
badge-info-raw: null
badges: {broadcaster: "1", glitchcon2020: "1"}
badges-raw: "broadcaster/1,glitchcon2020/1"
color: "#FF0000"
display-name: "xxx"
emote-sets: "0,19194,578795,1609658,300374282,300673968,300801751,300829526,301181113,301238972,301386037,301799809,301868774,302696035,302696036,302696037,302696038,302696039,302696040,303296797,303512912,303767435,303771896,304107606,477339272,564265402,592920959,610186276"
emotes: {}
emotes-raw: null
message-type: "action"
mod: false
subscriber: false
user-type: null
username: "xxx"

From Twitch web chat:

badge-info: null
badge-info-raw: null
badges: {broadcaster: "1", glitchcon2020: "1"}
badges-raw: "broadcaster/1,glitchcon2020/1"
client-nonce: "8b9421x7a14ax8247f9x48355x21c4xf"
color: "#FF0000"
display-name: "xxx"
emotes: null
emotes-raw: null
flags: null
id: "66xd115x-7x1d-41xd-82x7-8dx659x8ecxc"
message-type: "chat"
mod: false
room-id: "12345678"
subscriber: false
tmi-sent-ts: "1623864628744"
turbo: false
user-id: "12345678"
user-type: null
username: "xxx"
AlcaDesign commented 3 years ago

That are from two separate IRC commands. Top is of a USERSTATE, bottom is a chat message. tmi.js isn't leaving out any of the tags from the state. Are you referring to the docs?

sslanec commented 3 years ago

Ah, didn't realize that. My mistake.