From 277ea7e078494d3a4bab4c2473cc5b8abde37ac8 Mon Sep 17 00:00:00 2001 From: Hassan Abouelela Date: Mon, 21 Nov 2022 12:38:52 +0400 Subject: Make The Latex API URL Configurable Reads the latex API URL from an environment variable, to allow modifying it in prod. Signed-off-by: Hassan Abouelela --- bot/exts/fun/latex.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bot/exts/fun/latex.py') diff --git a/bot/exts/fun/latex.py b/bot/exts/fun/latex.py index b5dada1c..311b4ac2 100644 --- a/bot/exts/fun/latex.py +++ b/bot/exts/fun/latex.py @@ -1,4 +1,5 @@ import hashlib +import os import re import string from io import BytesIO @@ -23,7 +24,7 @@ FORMATTED_CODE_REGEX = re.compile( re.DOTALL | re.IGNORECASE, # "." also matches newlines, case insensitive ) -LATEX_API_URL = "https://rtex.probablyaweb.site/api/v2" +LATEX_API_URL = os.getenv("LATEX_API_URL", "https://rtex.probablyaweb.site/api/v2") PASTEBIN_URL = "https://paste.pythondiscord.com" THIS_DIR = Path(__file__).parent -- cgit v1.2.3