diff options
-rw-r--r-- | .gitignore | 2 | ||||
-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/resources/fun/latex_template.txt (renamed from bot/exts/fun/latex/template.txt) | 0 |
4 files changed, 8 insertions, 10 deletions
@@ -1,7 +1,7 @@ # bot (project-specific) log/* data/* -bot/exts/fun/latex/cache/* +bot/exts/fun/_latex_cache/* 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/resources/fun/latex_template.txt index a20cc279..a20cc279 100644 --- a/bot/exts/fun/latex/template.txt +++ b/bot/resources/fun/latex_template.txt |