3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-24 03:33:10 +01:00

Irc: introduce isServiceBot checker

This commit is contained in:
James Lu 2016-05-14 16:17:12 -07:00
parent 523ef714a0
commit 2e1163fdb8

View File

@ -804,6 +804,18 @@ class Irc():
"""
return self.isInternalClient(uid) and self.users[uid].manipulatable
def isServiceBot(self, uid):
"""
Checks whether the given UID is a registered service bot. If True,
returns the cooresponding ServiceBot object.
"""
if not uid:
return False
for sbot in world.services.values():
if uid == sbot.uids.get(self.name):
return sbot
return False
def getHostmask(self, user, realhost=False, ip=False):
"""
Returns the hostmask of the given user, if present. If the realhost option