aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/cogs/utils.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/bot/cogs/utils.py b/bot/cogs/utils.py
index 6562ea0b4..80cdd9210 100644
--- a/bot/cogs/utils.py
+++ b/bot/cogs/utils.py
@@ -42,20 +42,6 @@ Namespaces are one honking great idea -- let's do more of those!
ICON_URL = "https://www.python.org/static/opengraph-icon-200x200.png"
-def get_pep_zero_embed() -> Embed:
- """Send information about PEP 0."""
- pep_embed = Embed(
- title=f"**PEP 0 - Index of Python Enhancement Proposals (PEPs)**",
- description=f"[Link](https://www.python.org/dev/peps/)"
- )
- pep_embed.set_thumbnail(url=ICON_URL)
- pep_embed.add_field(name="Status", value="Active")
- pep_embed.add_field(name="Created", value="13-Jul-2000")
- pep_embed.add_field(name="Type", value="Informational")
-
- return pep_embed
-
-
class Utils(Cog):
"""A selection of utilities which don't have a clear category."""
@@ -233,7 +219,7 @@ class Utils(Cog):
# Handle PEP 0 directly because it's not in .rst or .txt so it can't be accessed like other PEPs.
if pep_number == 0:
- pep_embed = get_pep_zero_embed()
+ pep_embed = self.get_pep_zero_embed()
success = True
else:
pep_embed, success = await self.get_pep_embed(pep_number)
@@ -243,6 +229,20 @@ class Utils(Cog):
log.trace(f"PEP {pep_number} getting and sending finished successfully. Increasing stat.")
self.bot.stats.incr(f"pep_fetches.{pep_number}")
+ @staticmethod
+ def get_pep_zero_embed() -> Embed:
+ """Send information about PEP 0."""
+ pep_embed = Embed(
+ title=f"**PEP 0 - Index of Python Enhancement Proposals (PEPs)**",
+ description=f"[Link](https://www.python.org/dev/peps/)"
+ )
+ pep_embed.set_thumbnail(url=ICON_URL)
+ pep_embed.add_field(name="Status", value="Active")
+ pep_embed.add_field(name="Created", value="13-Jul-2000")
+ pep_embed.add_field(name="Type", value="Informational")
+
+ return pep_embed
+
@async_cache(arg_offset=1)
async def get_pep_embed(self, pep_nr: int) -> Tuple[Embed, bool]:
"""Fetch, generate and return PEP embed. Implement `async_cache`."""