|
|
|
@ -14,6 +14,7 @@ class Bot: |
|
|
|
self.server = None |
|
|
|
self.reactions = {} |
|
|
|
self.pings = [] |
|
|
|
self.tg_user_match = re.compile('^<(?P<username>.+)>') |
|
|
|
self.ping_match = re.compile('^(<.+> )?\@?{name}'.format(name=nickname)) |
|
|
|
|
|
|
|
def add_reaction(self, match, reaction): |
|
|
|
@ -47,6 +48,9 @@ class Bot: |
|
|
|
Every matched reactions. |
|
|
|
""" |
|
|
|
username = user.split('!')[0] |
|
|
|
tg_user_match = self.tg_user_match.match(message) |
|
|
|
if 'bot' in username.lower() and tg_user_match: |
|
|
|
username = '@' + tg_user_match.groupdict() |
|
|
|
|
|
|
|
context = { |
|
|
|
'server': self.server, |
|
|
|
|