Open dbkynd opened 4 years ago
The IRC parser that tmi.js uses (irc-message
by Fionn Kelleher (sigkell)) and many other parsers will parse an empty tag as true
.
https://github.com/tmijs/tmi.js/blob/92d7ccff8cecf33bc28c1f40612228e01943a4ff/lib/parser.js#L153
I personally wouldn't choose it to be true
but at this point I don't want any backwards incompatible changes. Perhaps an option could be added to change an empty tag to something else like null
or an empty string (my preference) with true
as the default.
RFC.
Oh hmm... interesting. Thanks for the prompt response! Options are always nice, but if that's a standard I can just deal with it.
Actual behaviour: Using the
raw_message
event, the RAW IRC message:'@badge-info=;badges=broadcaster/1,premium/1;color=#EC5D0F;display-name=DBKynd;emotes=;flags=;id=91544fb6-4e0a-411f-a379-771aad329f35;mod=0;room-id=59351240;subscriber=0;tmi-sent-ts=1587431682109;turbo=0;user-id=59351240;user-type= :dbkynd!dbkynd@dbkynd.tmi.twitch.tv PRIVMSG #dbkynd :dirk is great'
gets parsed aswhere
emotes=;flags=;
turns in toemotes: true, flags: true,
This is both on themessage
andmessageCloned
objects (for obvious reasons but thought I'd check both just in case)This same message captured using the
message
event parses those fields tonull
Expected behaviour:
These fields should be parsed as
null
similarly to how it is done in the message eventServer configuration