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

Fixed discord author parsing in replied messages for MirahezeLogbot #3588

Merged
merged 7 commits into from
Jan 9, 2024
8 changes: 5 additions & 3 deletions modules/irc/files/logbot/adminlogbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,11 @@ def on_pubmsg(self, con, event):
line = event.arguments[0]
if rest == self.config.relay_host:
import re
parsed = re.search(r'<(?P<discord>[a-z0-9._]*)> (?P<message>.*)', line)
discord_author = "@" + parsed.group('discord')
line = parsed.group('message')
parsed = re.search(r'<(?P<discord>[ a-z0-9._]*)> (?P<message>.*)', line)
if parsed.group('discord') is not None and parsed.group('message') is not None:
discord = parsed.group('discord').split()[0]
discord_author = "@" + discord
line = parsed.group('message')
if author in self.config.author_map:
author = self.config.author_map[author]
if discord_author in self.config.author_map:
Expand Down
Loading