From 00362198d0fef36e8973b8b034d161f5abd3113e Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 9 May 2021 11:56:16 +0100 Subject: Revert changes to int e This commit reverts the changes to int e, by giving the invoker instructions on how to access the export via int e. This means the metabase exports are not inserted to every int e envrionment. I have also added a seperate message in this commit to handle when the paste service is offline. --- bot/exts/moderation/metabase.py | 8 ++++++-- bot/exts/utils/internal.py | 4 ---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bot/exts/moderation/metabase.py b/bot/exts/moderation/metabase.py index f419edd05..6f05a320b 100644 --- a/bot/exts/moderation/metabase.py +++ b/bot/exts/moderation/metabase.py @@ -139,9 +139,13 @@ class Metabase(Cog): return paste_link = await send_to_paste_service(out, extension=extension) + if paste_link: + message = f":+1: {ctx.author.mention} Here's your link: {paste_link}" + else: + message = f":x: {ctx.author.mention} Link service is unavailible." await ctx.send( - f":+1: {ctx.author.mention} Here's your link: {paste_link}\n" - f"I've also saved it to `metabase[{question_id}]`, within the internal eval environment for you!" + f"{message}\nYou can also access this data within internal eval by doing: " + f"`bot.get_cog('Metabase').exports[{question_id}]`" ) # This cannot be static (must have a __func__ attribute). diff --git a/bot/exts/utils/internal.py b/bot/exts/utils/internal.py index 6a3ddb6e5..6f2da3131 100644 --- a/bot/exts/utils/internal.py +++ b/bot/exts/utils/internal.py @@ -156,10 +156,6 @@ class Internal(Cog): "contextlib": contextlib } - # If the Metabase cog is loaded, insert all the saved exports into the env - if metabase := self.bot.get_cog("Metabase"): - env["metabase"] = metabase.exports - self.env.update(env) # Ignore this code, it works -- cgit v1.2.3