mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 19:28:54 -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```'
|
||||
result = None
|
||||
|
||||
local_vars = locals().copy()
|
||||
local_vars['bot'] = self.bot
|
||||
global_vars = globals().copy()
|
||||
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:
|
||||
result = eval(code, globals(), local_vars)
|
||||
result = eval(code, global_vars, locals())
|
||||
except Exception as e:
|
||||
await self.bot.say(python.format(type(e).__name__ + ': ' + str(e)))
|
||||
return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user