Use Capability.copy() in metadata.py

This commit is contained in:
jesopo 2019-05-19 11:08:32 +01:00
parent 046bb2b8ae
commit f386351b7b

View file

@ -1,10 +1,12 @@
from src import IRCBot, ModuleManager, utils
CAP = utils.irc.Capability(None, "draft/metadata")
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")
cap = CAP.copy()
if cap.available(event["capabilities"]):
cap.on_ack(lambda: self._ack(event["server"]))
return cap