2019-07-09 20:25:43 +00:00
|
|
|
from src import EventManager, ModuleManager, utils
|
2019-06-19 21:37:03 +00:00
|
|
|
|
2021-06-12 04:52:13 +00:00
|
|
|
TAGS = {
|
|
|
|
utils.irc.MessageTag(None, "inspircd.org/bot"),
|
|
|
|
utils.irc.MessageTag(None, "draft/bot")
|
|
|
|
}
|
2019-06-19 21:37:03 +00:00
|
|
|
|
|
|
|
class Module(ModuleManager.BaseModule):
|
2021-06-12 04:52:13 +00:00
|
|
|
@utils.hook("received.376")
|
|
|
|
@utils.hook("received.422")
|
|
|
|
def botmode(self, event):
|
|
|
|
if "BOT" in event["server"].isupport:
|
|
|
|
botmode = event["server"].isupport["BOT"]
|
|
|
|
event["server"].send_raw("MODE %s +%s" % (event["server"].nickname, botmode))
|
|
|
|
|
2019-06-19 21:37:03 +00:00
|
|
|
@utils.hook("received.message.private")
|
|
|
|
@utils.hook("received.message.channel")
|
2019-07-09 20:25:43 +00:00
|
|
|
@utils.kwarg("priority", EventManager.PRIORITY_HIGH)
|
2019-06-19 21:37:03 +00:00
|
|
|
def message(self, event):
|
2021-06-12 04:52:13 +00:00
|
|
|
for tag in TAGS:
|
|
|
|
if tag.present(event["tags"]):
|
|
|
|
event.eat()
|