Use Capability.copy() in metadata.py
This commit is contained in:
parent
046bb2b8ae
commit
f386351b7b
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue