tweaks for readability

This commit is contained in:
deathbybandaid 2019-06-08 18:54:58 -04:00
parent c59a36e278
commit 4af9696c6c

View File

@ -31,16 +31,18 @@ class BotUsers():
else: else:
raise Exception('User dict does not contain a function or key ' + str(name.lower())) raise Exception('User dict does not contain a function or key ' + str(name.lower()))
def ID(self, nick): def ID(self, nickinput):
if is_number(nick): if is_number(nickinput):
if nick in list(self.dict["current"].keys()): nick_id = nickinput
return self.dict["current"][nick]["nick"] if nick_id in list(self.dict["current"].keys()):
elif nick in list(self.dict["all"].keys()) and len(self.dict["all"][nick]): nick = self.dict["current"][nick_id]["nick"]
return self.dict["all"][nick][0] elif nick_id in list(self.dict["all"].keys()) and len(self.dict["all"][nick_id]):
nick = self.dict["all"][nick_id][0]
else: else:
raise Exception('ID ' + str(nick) + ' does not appear to be associated with a nick') raise Exception('ID ' + str(nickinput) + ' does not appear to be associated with a nick')
return nick
else: else:
nick_id = self.whois_ident(nick) nick_id = self.whois_ident(nickinput)
return nick_id return nick_id
def whois_ident(self, nick): def whois_ident(self, nick):