aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/fun/latex.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bot/exts/fun/latex.py (renamed from bot/exts/fun/latex/_latex_cog.py)9
1 files changed, 7 insertions, 2 deletions
diff --git a/bot/exts/fun/latex/_latex_cog.py b/bot/exts/fun/latex.py
index 72d48b2a..ac43e95b 100644
--- a/bot/exts/fun/latex/_latex_cog.py
+++ b/bot/exts/fun/latex.py
@@ -23,9 +23,9 @@ LATEX_API_URL = "https://rtex.probablyaweb.site/api/v2"
PASTEBIN_URL = "https://paste.pythondiscord.com"
THIS_DIR = Path(__file__).parent
-CACHE_DIRECTORY = THIS_DIR / "cache"
+CACHE_DIRECTORY = THIS_DIR / "_latex_cache"
CACHE_DIRECTORY.mkdir(exist_ok=True)
-TEMPLATE = string.Template((THIS_DIR / "template.txt").read_text())
+TEMPLATE = string.Template(Path("bot/resources/fun/latex_template.txt").read_text())
def _prepare_input(text: str) -> str:
@@ -101,3 +101,8 @@ class Latex(commands.Cog):
image_path.unlink()
return
await ctx.send(file=discord.File(image_path, "latex.png"))
+
+
+def setup(bot: Bot) -> None:
+ """Load the Latex Cog."""
+ bot.add_cog(Latex(bot))