3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 12:12:53 +01:00

utils: add isOper() function

This commit is contained in:
James Lu 2015-07-10 16:42:53 -07:00
parent 1b4ec414cf
commit 7a6c32e0c4

View File

@ -259,3 +259,10 @@ def isInternalServer(irc, sid):
Returns whether <sid> is an internal PyLink PseudoServer.
"""
return (sid in irc.servers and irc.servers[sid].internal)
def isOper(irc, uid):
"""<irc object> <UID>
Returns whether <UID> is an opered client.
"""
return (uid in irc.users and ("o", None) in irc.users[uid].modes)