aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-06-22 18:48:34 +0300
committerGravatar ks129 <[email protected]>2020-06-22 18:48:34 +0300
commitdf3142485af13605d9663b055c39e558f7149a0f (patch)
treea244e696f4963f65217a6567b3042cb4ed499496
parentAsync Cache: Make cache handle different caches better (diff)
PEP: Filter out too big PEP numbers
-rw-r--r--bot/cogs/utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/cogs/utils.py b/bot/cogs/utils.py
index d4015e235..7dbc5b014 100644
--- a/bot/cogs/utils.py
+++ b/bot/cogs/utils.py
@@ -248,7 +248,11 @@ class Utils(Cog):
@async_cache(arg_offset=2)
async def get_pep_embed(self, ctx: Context, pep_nr: int) -> Optional[Embed]:
"""Fetch, generate and return PEP embed."""
- if pep_nr not in self.peps and (self.last_refreshed_peps + timedelta(minutes=30)) <= datetime.now():
+ if (
+ pep_nr not in self.peps
+ and (self.last_refreshed_peps + timedelta(minutes=30)) <= datetime.now()
+ and len(str(pep_nr)) < 5
+ ):
await self.refresh_peps_urls()
if pep_nr not in self.peps: