aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-11-21 12:38:52 +0400
committerGravatar Hassan Abouelela <[email protected]>2022-11-21 12:38:52 +0400
commit277ea7e078494d3a4bab4c2473cc5b8abde37ac8 (patch)
treee4c222945d497ea5d603612949c5fdfa438fa421
parentBump sentry-sdk from 1.10.1 to 1.11.0 (#1150) (diff)
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 <[email protected]>
-rw-r--r--bot/exts/fun/latex.py3
1 files changed, 2 insertions, 1 deletions
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