diff options
| author | 2020-03-28 10:54:03 +0200 | |
|---|---|---|
| committer | 2020-03-28 10:54:03 +0200 | |
| commit | aba5c321a5bbdaa9f47791b2aee456caa566cd98 (patch) | |
| tree | 5b16c09084e2a707e2beddaceeb4b7c29ccdf98b | |
| parent | Merge pull request #842 from python-discord/bug/util/831/snekbox-reeval-parsing (diff) | |
(PEP Command): Hard-coded PEP 0
| -rw-r--r-- | bot/cogs/utils.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bot/cogs/utils.py b/bot/cogs/utils.py index 024141d62..db8f63ff4 100644 --- a/bot/cogs/utils.py +++ b/bot/cogs/utils.py @@ -40,6 +40,14 @@ If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! """ +PEP0_TITLE = "Index of Python Enhancement Proposals (PEPs)" +PEP0_INFO = { + "Status": "Active", + "Created": "13-Jul-2000", + "Type": "Informational" +} +PEP0_LINK = "https://www.python.org/dev/peps/" + class Utils(Cog): """A selection of utilities which don't have a clear category.""" @@ -59,6 +67,19 @@ class Utils(Cog): await ctx.invoke(self.bot.get_command("help"), "pep") return + # Handle PEP 0 directly due it's not available like other PEPs (use constants) + if pep_number == 0: + pep_embed = Embed( + title=f"**PEP 0 - {PEP0_TITLE}**", + description=f"[Link]({PEP0_LINK})" + ) + pep_embed.set_thumbnail(url="https://www.python.org/static/opengraph-icon-200x200.png") + for field, value in PEP0_INFO.items(): + pep_embed.add_field(name=field, value=value) + + await ctx.send(embed=pep_embed) + return + possible_extensions = ['.txt', '.rst'] found_pep = False for extension in possible_extensions: |