commands: replace eval with getattr
This commit is contained in:
parent
d1fea9263c
commit
97abebeedb
|
@ -127,9 +127,9 @@ class Command:
|
|||
return
|
||||
if command not in self.config.cmd.disabled:
|
||||
if needs_prefix == False:
|
||||
eval(f"self.{command}()")
|
||||
getattr(self, command)()
|
||||
elif not (self.prefix == None and self.pm == False):
|
||||
eval(f"self.{command}()")
|
||||
getattr(self, command)()
|
||||
|
||||
# else:
|
||||
# self.mesg("this ain't a valid commanderoonie, you twat")
|
||||
|
@ -306,7 +306,7 @@ class Command:
|
|||
mesg(f"admin commands: {admin_commands}")
|
||||
else:
|
||||
try:
|
||||
mesg(f"{topic}: " + eval(f"self.{topic}.__doc__"))
|
||||
mesg(f"{topic}: " + getattr(self, topic).__doc__)
|
||||
except (TypeError, AttributeError) as e:
|
||||
# mesg(str( e.__class__.__name__ ))
|
||||
if topic in abs_topics:
|
||||
|
|
Loading…
Reference in New Issue