mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-10 21:50:59 -05:00
remove getattr
This commit is contained in:
parent
dbc3f9e6a8
commit
1c8ea3ac5b
@ -45,14 +45,6 @@ class BotChannels():
|
|||||||
|
|
||||||
self.who_reqs = {}
|
self.who_reqs = {}
|
||||||
|
|
||||||
def __getattr__(self, name):
|
|
||||||
''' will only get called for undefined attributes '''
|
|
||||||
"""We will try to find a dict value, or return None"""
|
|
||||||
if name.lower() in list(self.dict.keys()):
|
|
||||||
return self.dict[str(name).lower()]
|
|
||||||
else:
|
|
||||||
raise Exception('Channel dict does not contain a function or key ' + str(name.lower()))
|
|
||||||
|
|
||||||
def total_channels(self):
|
def total_channels(self):
|
||||||
totalcount = len(list(self.chandict.keys()))
|
totalcount = len(list(self.chandict.keys()))
|
||||||
return totalcount
|
return totalcount
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user