X-Git-Url: https://jfr.im/git/erebus.git/blobdiff_plain/c6b4a1774b75849ea859fc0ac0665680142def8a..f7e0fcf41c208d311f6f9074560975bac1181a39:/modules/twitch.py diff --git a/modules/twitch.py b/modules/twitch.py index 466d430..fdd7b32 100644 --- a/modules/twitch.py +++ b/modules/twitch.py @@ -22,36 +22,10 @@ import urllib2 import json checkfor = "twitch" -hostmask_regex = re.compile('^(.*)!(.*)@(.*)$') url_regex = re.compile('(http|ftp|https):\/\/([\w\-_]+(?:(?:\.[\w\-_]+)+))([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?') -def parser_hostmask(hostmask): - if isinstance(hostmask, dict): - return hostmask - - nick = None - user = None - host = None - - if hostmask is not None: - match = hostmask_regex.match(hostmask) - - if not match: - nick = hostmask - else: - nick = match.group(1) - user = match.group(2) - host = match.group(3) - - return { - 'nick': nick, - 'user': user, - 'host': host - } @lib.hooknum("PRIVMSG") def privmsg_hook(bot, line): - sender = parser_hostmask(line[1:line.find(' ')]) - try: linetx = line.split(None, 3)[3][1:] except IndexError: