aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/utilities/rfc.py
diff options
context:
space:
mode:
authorGravatar SomeHybrid <[email protected]>2023-08-23 19:55:43 +0700
committerGravatar SomeHybrid <[email protected]>2023-08-23 19:55:43 +0700
commit6cff59d144d7b6902ca577030439f83cf8bea1b5 (patch)
tree277404ab281430d105084cc0e3a0fde38133b43e /bot/exts/utilities/rfc.py
parentAdded URL to RFC embed (diff)
Changed cooldown to 5s, removed description if abstract not found
Diffstat (limited to 'bot/exts/utilities/rfc.py')
-rw-r--r--bot/exts/utilities/rfc.py10
1 files changed, 3 insertions, 7 deletions
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."""