Skip to content

Commit

Permalink
rework directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ShakyaMajumdar committed Jan 21, 2022
1 parent 7e51db4 commit 9d49fa0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# bot (project-specific)
log/*
data/*
bot/exts/fun/latex/cache/*
bot/exts/fun/_latex_cache/*



Expand Down
9 changes: 7 additions & 2 deletions bot/exts/fun/latex/_latex_cog.py → bot/exts/fun/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
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:
Expand Down Expand Up @@ -101,3 +101,8 @@ async def latex(self, ctx: commands.Context, *, query: str) -> None:
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))
7 changes: 0 additions & 7 deletions bot/exts/fun/latex/__init__.py

This file was deleted.

File renamed without changes.

0 comments on commit 9d49fa0

Please sign in to comment.