fully support draft/bot spec
This commit is contained in:
parent
498c1ea193
commit
07fcbd6c9e
1 changed files with 14 additions and 3 deletions
|
@ -1,11 +1,22 @@
|
||||||
from src import EventManager, ModuleManager, utils
|
from src import EventManager, ModuleManager, utils
|
||||||
|
|
||||||
TAG = utils.irc.MessageTag(None, "inspircd.org/bot")
|
TAGS = {
|
||||||
|
utils.irc.MessageTag(None, "inspircd.org/bot"),
|
||||||
|
utils.irc.MessageTag(None, "draft/bot")
|
||||||
|
}
|
||||||
|
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
|
@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))
|
||||||
|
|
||||||
@utils.hook("received.message.private")
|
@utils.hook("received.message.private")
|
||||||
@utils.hook("received.message.channel")
|
@utils.hook("received.message.channel")
|
||||||
@utils.kwarg("priority", EventManager.PRIORITY_HIGH)
|
@utils.kwarg("priority", EventManager.PRIORITY_HIGH)
|
||||||
def message(self, event):
|
def message(self, event):
|
||||||
if TAG.present(event["tags"]):
|
for tag in TAGS:
|
||||||
event.eat()
|
if tag.present(event["tags"]):
|
||||||
|
event.eat()
|
||||||
|
|
Loading…
Reference in a new issue