From 7a6c32e0c4535a2bcb5d0c3b4017816b397e79b5 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 10 Jul 2015 16:42:53 -0700 Subject: [PATCH] utils: add isOper() function --- utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils.py b/utils.py index aa34d57..273e475 100644 --- a/utils.py +++ b/utils.py @@ -259,3 +259,10 @@ def isInternalServer(irc, sid): Returns whether is an internal PyLink PseudoServer. """ return (sid in irc.servers and irc.servers[sid].internal) + +def isOper(irc, uid): + """ + + Returns whether is an opered client. + """ + return (uid in irc.users and ("o", None) in irc.users[uid].modes)