Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message regex problems #24

Closed
parklez opened this issue Mar 18, 2021 · 2 comments
Closed

Message regex problems #24

parklez opened this issue Mar 18, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@parklez
Copy link
Owner

parklez commented Mar 18, 2021

@badge-info=subscriber/45;badges=broadcaster/1,subscriber/0,premium/1;client-nonce=e82f3c0e5259ab25d21f55fe8096ba00;color=#88CEFF;display-name=leparklez;emotes=1:4-5;flags=0-2:P.3;id=46a94f45-b6f8-4094-80a2-472a1f8cefe8;mod=0;room-id=45453555;subscriber=1;tmi-sent-ts=1616027196869;turbo=0;user-id=45453555;user-type= :leparklez!leparklez@leparklez.tmi.twitch.tv PRIVMSG #fulano :hello this breaks :)) :)
Outputs:
username: fulano :hello this breaks :))
message: )

@parklez parklez added the bug Something isn't working label Mar 18, 2021
@parklez parklez changed the title regex fails in case of colon and parentheses regex fails in case of space and colon Mar 18, 2021
@parklez
Copy link
Owner Author

parklez commented Apr 1, 2021

DEBUG    | @badge-info=;badges=premium/1;client-nonce=ad3d75efc24561654e2606b727a07795;color=#197FB3;display-name=Commander_Warthog;emotes=;flags=;id=fc95bd39-d94e-43c4-8842-2755b3668043;mod=0;room-id=48533154;subscriber=0;tmi-sent-ts=1617289681027;turbo=0;user-id=208154467;user-type= :commander_warthog!commander_warthog@commander_warthog.tmi.twitch.tv PRIVMSG #bawkbasoup :Ew, cosplayers!

DEBUG    | @badge-info=subscriber/25;badges=subscriber/24,sub-gifter/25;client-nonce=b2bd74fa02fb1f140ef552eecc784667;color=#8F2E92;display-name=Catmeat_;emote-only=1;emotes=305315024:0-8;flags=;id=d47d1c1d-78c5-49aa-8a2d-01bca0f2bc37;mod=0;room-id=48533154;subscriber=1;tmi-sent-ts=1617289681184;turbo=0;user-id=150680987;user-type= :catmeat_!catmeat_@catmeat_.tmi.twitch.tv PRIVMSG #bawkbasoup :bawkSweat  
@badge-info=subscriber/11;badges=subscriber/9,sub-gifter/1;client-nonce=25a058ac5f56dd2eb9913e0e16bddfd5;color=#8A2BE2;display-name=ItsMattwood;emotes=;flags=;id=f2ddfb03-7d07-4353-a0e1-4d348429a952;mod=0;room-id=48533154;subscriber=1;tmi-sent-ts=1617289681800;turbo=0;user-id=36442605;user-type= :itsmattwood!itsmattwood@itsmattwood.tmi.twitch.tv PRIVMSG #bawkbasoup :AH D:
@badge-info=subscriber/3;badges=subscriber/2003,premium/1;client-nonce=d42cd88328c3a49e7a4922c2c621e10d;color=#DAA520;display-name=kPoisson;emotes=;flags=;id=1a3d6541-bda0-47e9-8d11-de9ed8f736e7;mod=0;room-id=48533154;subscriber=1;tmi-sent-ts=1617289682287;turbo=0;user-id=58384124;user-type= :kpoisson!kpoisson@kpoisson.tmi.twitch.tv PRIVMSG #bawkbasoup :AAAAAA
@badge-info=;badges=premium/1;client-nonce=f3713ccd49d35539531e3cc1728b3068;color=#008000;display-name=goldreaver;emotes=;flags=;id=f38589c8-c514-4b1d-83b1-c34085061a82;mod=0;room-id=48533154;subscriber=0;tmi-sent-ts=1617289682428;turbo=0;user-id=37786985;user-type= :goldreaver!goldreaver@goldreaver.tm   
DEBUG    | i.twitch.tv PRIVMSG #bawkbasoup :nice this is the uncut version

Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Users\Andreas\AppData\Local\Programs\Python\Python37\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "C:\Users\Andreas\AppData\Local\Programs\Python\Python37\lib\threading.py", line 865, in run   
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Andreas\Documents\GitHub\twitch-bot\parky_bot\twitch\bot.py", line 64, in pooling    
    m = Message(line)
  File "C:\Users\Andreas\Documents\GitHub\twitch-bot\parky_bot\models\message.py", line 31, in __init__
    self.parse()
  File "C:\Users\Andreas\Documents\GitHub\twitch-bot\parky_bot\models\message.py", line 55, in parse  
    self.message) = re.search(regex, self.string).groups()
AttributeError: 'NoneType' object has no attribute 'groups'

image

@parklez parklez changed the title regex fails in case of space and colon Message regex problems Apr 1, 2021
@parklez
Copy link
Owner Author

parklez commented Apr 1, 2021

Nailed both with 6b4cf57

@parklez parklez closed this as completed Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant