mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 03:38:53 -05:00
Debug scoping fix (#305)
This commit is contained in:
parent
ca09c4d229
commit
550dfb5875
@ -170,11 +170,16 @@ class Owner:
|
|||||||
python = '```py\n{}\n```'
|
python = '```py\n{}\n```'
|
||||||
result = None
|
result = None
|
||||||
|
|
||||||
local_vars = locals().copy()
|
global_vars = globals().copy()
|
||||||
local_vars['bot'] = self.bot
|
global_vars['bot'] = self.bot
|
||||||
|
global_vars['ctx'] = ctx
|
||||||
|
global_vars['message'] = ctx.message
|
||||||
|
global_vars['author'] = ctx.message.author
|
||||||
|
global_vars['channel'] = ctx.message.channel
|
||||||
|
global_vars['server'] = ctx.message.server
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = eval(code, globals(), local_vars)
|
result = eval(code, global_vars, locals())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
await self.bot.say(python.format(type(e).__name__ + ': ' + str(e)))
|
await self.bot.say(python.format(type(e).__name__ + ': ' + str(e)))
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user