diff options
| author | 2019-11-14 11:48:51 +0000 | |
|---|---|---|
| committer | 2019-11-14 11:48:51 +0000 | |
| commit | 160fab8f4fe485c3a32e94f5d36d1ccd1833d41c (patch) | |
| tree | 09e0ddaecf4ef8257ee334f2516472b482c8bbc8 /modules/print_activity.py | |
| parent | Show more fediverse errors to the end user (diff) | |
| signature | ||
separate formatted lines from pretty formatted lines
Diffstat (limited to 'modules/print_activity.py')
| -rw-r--r-- | modules/print_activity.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/print_activity.py b/modules/print_activity.py index 2a4ae77f..2852fe8e 100644 --- a/modules/print_activity.py +++ b/modules/print_activity.py @@ -6,11 +6,18 @@ from src import EventManager, ModuleManager, utils @utils.export("botset", utils.BoolSetting("print-motd", "Set whether I print /motd")) +@utils.export("botset", utils.BoolSetting("pretty-activity", + "Whether or not to pretty print activity")) class Module(ModuleManager.BaseModule): def _print(self, event): + line = event["line"] + if ("pretty" in event and + self.bot.get_setting("pretty-activity", False)): + line = event["pretty"] + self.bot.log.info("%s%s | %s", [ str(event["server"]), event["context"] or "", - utils.irc.parse_format(event["line"])]) + utils.irc.parse_format(line)]) @utils.hook("formatted.message.channel") @utils.hook("formatted.notice.channel") |
