forked from jan6/bot6
1
0
Fork 0

commands: replace eval with getattr

This commit is contained in:
xfnw 2024-04-09 14:23:37 -04:00
parent d1fea9263c
commit 97abebeedb
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")
@ -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: