From 6cff59d144d7b6902ca577030439f83cf8bea1b5 Mon Sep 17 00:00:00 2001 From: SomeHybrid <91648368+SomeHybrid@users.noreply.github.com> Date: Wed, 23 Aug 2023 19:55:43 +0700 Subject: Changed cooldown to 5s, removed description if abstract not found --- bot/exts/utilities/rfc.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'bot/exts/utilities/rfc.py') diff --git a/bot/exts/utilities/rfc.py b/bot/exts/utilities/rfc.py index 8dbee03a..d9840592 100644 --- a/bot/exts/utilities/rfc.py +++ b/bot/exts/utilities/rfc.py @@ -41,16 +41,12 @@ class Rfc(commands.Cog): data = await resp.json() - description = ( - data["abstract"] - or f"[Link]({DOCUMENT_URL.format(rfc_id=rfc_id)}" - ) + description = data["abstract"] revisions = data["rev"] or len(data["rev_history"]) raw_date = data["rev_history"][0]["published"] - creation_date = datetime.datetime.strptime( - raw_date, "%Y-%m-%dT%H:%M:%S%z") + creation_date = datetime.datetime.strptime(raw_date, "%Y-%m-%dT%H:%M:%S%z") document = RfcDocument( title=data["title"], @@ -63,7 +59,7 @@ class Rfc(commands.Cog): return document - @commands.cooldown(1, 10, commands.BucketType.user) + @commands.cooldown(1, 5, commands.BucketType.user) @commands.command() async def rfc(self, ctx: commands.Context, rfc_id: int) -> None: """Sends the corresponding RFC with the given ID.""" -- cgit v1.2.3