diff --git a/modules/irc/files/logbot/adminlogbot.py b/modules/irc/files/logbot/adminlogbot.py index 3c92186171..0da0d03193 100644 --- a/modules/irc/files/logbot/adminlogbot.py +++ b/modules/irc/files/logbot/adminlogbot.py @@ -145,10 +145,16 @@ def on_pubmsg(self, con, event): return author, rest = event.source.split('!') cloak = self.get_cloak(event.source) + line = event.arguments[0] + if rest == self.config.relay_host: + import re + parsed = re.search(r'<(?P[a-z0-9._]*)> (?P.*)', line) + discord_author = "@" + parsed.group('discord') + line = parsed.group('message') if author in self.config.author_map: author = self.config.author_map[author] - line = event.arguments[0] - + if discord_author in self.config.author_map: + discord_author = self.config.author_map[discord_author] if (line.startswith(self.config.nick) or line.startswith("!%s" % self.config.nick) or line.lower() == "!log help"): @@ -246,7 +252,7 @@ def on_pubmsg(self, con, event): project = "" message = arr[1] try: - pageurl = adminlog.log(self.config, message, project, author) + pageurl = adminlog.log(self.config, message, project, discord_author or author) if author in self.config.title_map: title = self.config.title_map[author] else: diff --git a/modules/irc/templates/logbot/config.py b/modules/irc/templates/logbot/config.py index e1df49f769..d8ba2c0539 100644 --- a/modules/irc/templates/logbot/config.py +++ b/modules/irc/templates/logbot/config.py @@ -124,3 +124,6 @@ # Whether we "warn" or "error" if the user isn't in the trust list required_users_mode = "warn" + +# Host for to identify Relay bot for relayied log commands +relay_host = "~MirahezeR@miraheze/bot/MirahezeRelay" \ No newline at end of file