cinchrb / cinch

The IRC Bot Building Framework
http://www.rubydoc.info/gems/cinch
MIT License
1k stars 180 forks source link

IRCv3 tags broken if tag value contains a colon #250

Open aetaric opened 6 years ago

aetaric commented 6 years ago

It looks like the regex on line 100 of lib/cinch/message.rb is broken for twitch IRCv3 when emotes are used in the message:

Example message that breaks the regex: @badges=moderator/1,subscriber/24,bits/50000;color=#D63F50;display-name=CyclopsDragon;emotes=15017:11-16;id=e4964802-5310-449d-b8f1-52be38ff1d26;mod=1;room-id=21836069;sent-ts=1502929472853;subscriber=1;tmi-sent-ts=1502929475647;turbo=0;user-id=6342406;user-type=mod :cyclopsdragon!cyclopsdragon@cyclopsdragon.tmi.twitch.tv PRIVMSG #geoff :hi gibeDu

On Twitch's IRC the emotes tag will contain a colon which breaks the regex preventing the message from being parsed.

Defman21 commented 6 years ago

http://regexr.com/3giql

I built a new regex. Looks like it's working. Could you test it with some other messages? :)

aetaric commented 6 years ago

Not sure if that regex is used to parse the messages on login, but the bot is no longer joining channels or requesting caps with that regex in place.

craysiii commented 6 years ago

Pretty sure I've fixed it here: craysiii@72c3ee6bcba3b801b9b1aea9853574d1183cd6fb

Not sure if I should make a pull request, haven't tested it on a "normal" IRC network.

aetaric commented 6 years ago

Confirmed working on Twitch.