From f512ae1b336b0c5b3bd85d312256d7fc29d17cdf Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 15 Mar 2017 23:46:13 -0700 Subject: [PATCH] Protocol: add a hasCap() wrapper function (#337) --- classes.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/classes.py b/classes.py index 57b8ca4..8fd300d 100644 --- a/classes.py +++ b/classes.py @@ -1409,6 +1409,12 @@ class Protocol(): return real_args + def hasCap(capab): + """ + Returns whether this protocol module instance has the requested capability. + """ + return capab.lower() in self.protocol_caps + def removeClient(self, numeric): """Internal function to remove a client from our internal state.""" for c, v in self.irc.channels.copy().items():