1
0
Fork 0
mirror of synced 2024-06-27 02:31:04 +12:00

Added a debug command for the voice shards

This commit is contained in:
Phxntxm 2017-02-17 22:14:38 -06:00
parent f8cb681480
commit d9976dfd87

View file

@ -320,6 +320,34 @@ class Music:
pass
await self.bot.delete_message(message)
@commands.command(pass_context=True)
@commands.check(utils.is_owner)
async def vdebug(self, ctx, *, code : str):
"""Evaluates code."""
code = code.strip('` ')
python = '```py\n{}\n```'
result = None
env = {
'bot': self.bot,
'ctx': ctx,
'message': ctx.message,
'server': ctx.message.server,
'channel': ctx.message.channel,
'author': ctx.message.author
}
env.update(globals())
try:
result = eval(code, env)
if inspect.isawaitable(result):
result = await result
except Exception as e:
await self.bot.say(python.format(type(e).__name__ + ': ' + str(e)))
return
await self.bot.say(python.format(result))
@commands.command(pass_context=True, no_pm=True)
@utils.custom_perms(send_messages=True)