commands: replace eval with getattr #9

Merged
jan6 merged 2 commits from xfnw/bot6:getattr into master 2024-05-20 16:51:22 +00:00
1 changed files with 3 additions and 3 deletions

View File

@ -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")
@ -314,7 +314,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: