Add eval command
This commit is contained in:
parent
5e8701e1f3
commit
4ec596ae40
1 changed files with 6 additions and 0 deletions
|
@ -236,6 +236,12 @@ class DevCog(commands.Cog):
|
|||
output = subprocess.check_output(["cloc", "."]).decode("UTF-8")
|
||||
await ctx.send(f"```\n{output}\n```")
|
||||
|
||||
@commands.is_owner()
|
||||
@commands.command(name=eval)
|
||||
async def _eval(self, ctx, *, code: str):
|
||||
output = eval(code, locals=locals(), globals=globals())
|
||||
await ctx.send(f"```{output}```")
|
||||
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(DevCog(bot))
|
||||
|
|
Loading…
Add table
Reference in a new issue