aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-03-06 08:08:20 +0000
committerGravatar jesopo2019-03-06 08:08:20 +0000
commitb5b841033f94feb9d7074137bf8a085c3a6ab4ad (patch)
treea857a7a96a393041fc8dc63dc6fb90cea00a03a4 /modules
parent'pull' -> 'PR' in !ghpull (diff)
signature
Do format parsing (color, bold, etc) in format_activity.py
Diffstat (limited to 'modules')
-rw-r--r--modules/format_activity.py4
-rw-r--r--modules/print_activity.py7
2 files changed, 4 insertions, 7 deletions
diff --git a/modules/format_activity.py b/modules/format_activity.py
index 2e973296..c7edbec0 100644
--- a/modules/format_activity.py
+++ b/modules/format_activity.py
@@ -3,8 +3,8 @@ from src import EventManager, ModuleManager, utils
class Module(ModuleManager.BaseModule):
def _event(self, type, server, line, context):
- self.events.on("formatted").on(type).call(server=server, line=line,
- context=context)
+ self.events.on("formatted").on(type).call(server=server,
+ context=context, line=utils.irc.parse_format(line))
def _mode_symbols(self, user, channel, server):
modes = channel.get_user_status(user)
diff --git a/modules/print_activity.py b/modules/print_activity.py
index 48b539f5..3b0e7825 100644
--- a/modules/print_activity.py
+++ b/modules/print_activity.py
@@ -2,10 +2,6 @@ import datetime
from src import EventManager, ModuleManager, utils
class Module(ModuleManager.BaseModule):
- def _print_line(self, target, context, line):
- formatted_line = utils.irc.parse_format(line)
- self.bot.log.info("%s%s | %s", [target, context or "", formatted_line])
-
@utils.hook("formatted.message.channel")
@utils.hook("formatted.notice.channel")
@utils.hook("formatted.join")
@@ -21,4 +17,5 @@ class Module(ModuleManager.BaseModule):
@utils.hook("formatted.rename")
@utils.hook("formatted.motd")
def formatted(self, event):
- self._print_line(str(event["server"]), event["context"], event["line"])
+ self.bot.log.info("%s%s | %s", [
+ str(event["server"]), event["context"] or "", event["line"]])