Skip to content

Commit d1942a6

Browse files
fix(dev): don't load eval if snekbox is not configured
1 parent 8c8aaff commit d1942a6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

monty/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class Icons:
209209

210210
class URLs:
211211
paste_service = environ.get("PASTE_SERVICE", "")
212-
snekbox_api = environ.get("SNEKBOX_URL")
212+
snekbox_api = environ.get("SNEKBOX_URL", "")
213213
snekbox_auth = environ.get("SNEKBOX_AUTH")
214214
black_formatter = environ.get("BLACK_API")
215215
black_playground = environ.get("BLACK_PLAYGROUND", "https://black.vercel.app/")

monty/exts/python/eval.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,4 +552,7 @@ async def view_snekbox_package(self, ctx: commands.Context, package: str) -> Non
552552

553553
def setup(bot: Monty) -> None:
554554
"""Load the Snekbox cog."""
555+
if not URLs.snekbox_api:
556+
log.warning("Snekbox URL not configured, not loading Snekbox cog.")
557+
return
555558
bot.add_cog(Snekbox(bot))

0 commit comments

Comments
 (0)