2018-07-15 13:14:20 +00:00
|
|
|
import datetime
|
2018-10-03 12:22:37 +00:00
|
|
|
from src import EventManager, ModuleManager, utils
|
2018-07-15 13:14:20 +00:00
|
|
|
|
2019-01-02 13:39:49 +00:00
|
|
|
DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
|
|
|
|
|
2018-09-27 10:46:10 +00:00
|
|
|
class Module(ModuleManager.BaseModule):
|
2019-03-05 09:19:06 +00:00
|
|
|
def _print_line(self, target, context, line):
|
2019-01-13 21:56:36 +00:00
|
|
|
formatted_line = utils.irc.parse_format(line)
|
2019-03-05 09:19:06 +00:00
|
|
|
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")
|
|
|
|
@utils.hook("formatted.part")
|
|
|
|
@utils.hook("formatted.nick")
|
|
|
|
@utils.hook("formatted.server-notice")
|
|
|
|
@utils.hook("formatted.invite")
|
|
|
|
@utils.hook("formatted.mode.channel")
|
|
|
|
@utils.hook("formatted.topic")
|
|
|
|
@utils.hook("formatted.topic-timestamp")
|
|
|
|
@utils.hook("formatted.kick")
|
|
|
|
@utils.hook("formatted.quit")
|
|
|
|
@utils.hook("formatted.rename")
|
|
|
|
@utils.hook("formatted.motd")
|
|
|
|
def formatted(self, event):
|
|
|
|
self._print_line(str(event["server"]), event["context"], event["line"])
|