Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rate limit :latex #434

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
5 changes: 4 additions & 1 deletion cdbot/cogs/maths.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from PIL import Image
from discord import Colour, Embed, File, Member, Message, Reaction
from discord.ext import tasks
from discord.ext.commands import Bot, Cog, Context, command
from discord.ext.commands import Bot, BucketType, Cog, Context, command, cooldown
from html2markdown import convert

from cdbot.constants import Maths as constants
Expand Down Expand Up @@ -144,6 +144,9 @@ async def challenge(self, ctx: Context, number: int = 1):
return await ctx.send(embed=embed)

@command()
@cooldown(1, 60, BucketType.user)
@cooldown(4, 60, BucketType.channel)
@cooldown(6, 3600, BucketType.guild)
async def latex(self, ctx: Context, *, expression: str):
"""
Render a LaTeX expression with https://quicklatex.com/
Expand Down