Add first version of metadata.py - for ircv3 draft/metadata
This commit is contained in:
parent
99ce2ac6dd
commit
7cccb482b7
1 changed files with 14 additions and 0 deletions
14
modules/metadata.py
Normal file
14
modules/metadata.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
from src import ModuleManager, utils
|
||||||
|
|
||||||
|
class Module(ModuleManager.BaseModule):
|
||||||
|
@utils.hook("received.cap.new")
|
||||||
|
@utils.hook("received.cap.ls")
|
||||||
|
def on_cap(self, event):
|
||||||
|
cap = utils.irc.Capability(None, "draft/metadata")
|
||||||
|
if cap.available(event["capabilities"]):
|
||||||
|
cap.on_ack(lambda: self._ack(event["server"]))
|
||||||
|
return cap
|
||||||
|
|
||||||
|
def _cap(self, server):
|
||||||
|
url = self.bot.get_setting("bot-url", IRCBot.SOURCE)
|
||||||
|
server.send_raw("METADATA * SET bot-url :%s" % url)
|
Loading…
Reference in a new issue