Updated debug command to print an error
This commit is contained in:
parent
cce19493c1
commit
2e7906fd4a
|
@ -46,6 +46,7 @@ class Owner:
|
||||||
@commands.check(checks.isOwner)
|
@commands.check(checks.isOwner)
|
||||||
async def debug(self, ctx):
|
async def debug(self, ctx):
|
||||||
"""Executes code"""
|
"""Executes code"""
|
||||||
|
try:
|
||||||
match_single = getter.findall(ctx.message.content)
|
match_single = getter.findall(ctx.message.content)
|
||||||
match_multi = multi.findall(ctx.message.content)
|
match_multi = multi.findall(ctx.message.content)
|
||||||
if not match_multi:
|
if not match_multi:
|
||||||
|
@ -58,6 +59,8 @@ class Owner:
|
||||||
def r(v):
|
def r(v):
|
||||||
self.bot.loop.create_task(self.bot.say("```\n{}```".format(v)))
|
self.bot.loop.create_task(self.bot.say("```\n{}```".format(v)))
|
||||||
exec(match_multi[0])
|
exec(match_multi[0])
|
||||||
|
except Exception as error:
|
||||||
|
await bot.send_message(ctx.message.channel, fmt.format(type(error).__name__, error))
|
||||||
|
|
||||||
@commands.command(pass_context=True)
|
@commands.command(pass_context=True)
|
||||||
@commands.check(checks.isOwner)
|
@commands.check(checks.isOwner)
|
||||||
|
|
Loading…
Reference in a new issue