2019-05-25 21:40:06 +01:00
|
|
|
#--depends-on config
|
|
|
|
#--depends-on format_activity
|
|
|
|
|
2018-07-15 14:14:20 +01:00
|
|
|
import datetime
|
2018-10-03 13:22:37 +01:00
|
|
|
from src import EventManager, ModuleManager, utils
|
2018-07-15 14:14:20 +01:00
|
|
|
|
2019-05-02 10:24:01 +01:00
|
|
|
@utils.export("botset", {"setting": "print-motd",
|
2019-05-23 10:28:14 +01:00
|
|
|
"help": "Set whether I print /motd", "validate": utils.bool_or_none,
|
|
|
|
"example": "on"})
|
2018-09-27 11:46:10 +01:00
|
|
|
class Module(ModuleManager.BaseModule):
|
2019-05-02 10:24:01 +01:00
|
|
|
def _print(self, event):
|
|
|
|
self.bot.log.info("%s%s | %s", [
|
|
|
|
str(event["server"]), event["context"] or "",
|
|
|
|
utils.irc.parse_format(event["line"])])
|
|
|
|
|
2019-03-05 09:19:06 +00:00
|
|
|
@utils.hook("formatted.message.channel")
|
|
|
|
@utils.hook("formatted.notice.channel")
|
2019-03-06 08:08:40 +00:00
|
|
|
@utils.hook("formatted.notice.private")
|
2019-03-05 09:19:06 +00:00
|
|
|
@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")
|
|
|
|
def formatted(self, event):
|
2019-05-02 10:24:01 +01:00
|
|
|
self._print(event)
|
|
|
|
|
|
|
|
@utils.hook("formatted.motd")
|
|
|
|
def motd(self, event):
|
|
|
|
if self.bot.get_setting("print-motd", True):
|
|
|
|
self._print(event)
|