diff options
Diffstat (limited to 'bot/exts')
-rw-r--r-- | bot/exts/fun/latex.py (renamed from bot/exts/fun/latex/_latex_cog.py) | 9 | ||||
-rw-r--r-- | bot/exts/fun/latex/__init__.py | 7 | ||||
-rw-r--r-- | bot/exts/fun/latex/template.txt | 5 |
3 files changed, 7 insertions, 14 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)) diff --git a/bot/exts/fun/latex/__init__.py b/bot/exts/fun/latex/__init__.py deleted file mode 100644 index e58e0447..00000000 --- a/bot/exts/fun/latex/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -from bot.bot import Bot -from bot.exts.fun.latex._latex_cog import Latex - - -def setup(bot: Bot) -> None: - """Load the Latex Cog.""" - bot.add_cog(Latex(bot)) diff --git a/bot/exts/fun/latex/template.txt b/bot/exts/fun/latex/template.txt deleted file mode 100644 index a20cc279..00000000 --- a/bot/exts/fun/latex/template.txt +++ /dev/null @@ -1,5 +0,0 @@ -\documentclass{article} -\begin{document} - \pagenumbering{gobble} - $text -\end{document} |