mirror of
https://github.com/TotalFreedomMC/TotalFreedomBot.git
synced 2024-12-22 23:54:58 +00:00
Update miscellaneous.py
This commit is contained in:
parent
e2a8768a42
commit
8058d5639b
1 changed files with 2 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
import discord
|
import discord
|
||||||
import events
|
import events
|
||||||
|
import ast
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
|
@ -76,7 +77,7 @@ class Miscellaneous(commands.Cog):
|
||||||
async def debug(self, ctx, *, cmd):
|
async def debug(self, ctx, *, cmd):
|
||||||
'Executes a line of code'
|
'Executes a line of code'
|
||||||
try:
|
try:
|
||||||
result = eval(cmd)
|
result = ast.literal_eval(cmd)
|
||||||
if asyncio.iscoroutine(result):
|
if asyncio.iscoroutine(result):
|
||||||
result = await result
|
result = await result
|
||||||
await ctx.send(f'''```py
|
await ctx.send(f'''```py
|
||||||
|
|
Loading…
Reference in a new issue