aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2019-10-01 23:41:09 +0200
committerGravatar Leon Sandøy <[email protected]>2019-10-01 23:41:09 +0200
commit514576666ff7856ca09e049cb90ee8ac993107e2 (patch)
tree8ff2a74d6d7eb96171665e7bb41bcc4a6036ce08
parentUpdate contrib doc for new wiki links (#470) (diff)
Create !tools alias and split !site resources.
This splits the former !site resources into two separate commands, one for !site resources and one for !site tools. This makes sense now that we've split up the lists into two pages. It also adds a new alias, !tools, to call this command. This addresses #478. https://github.com/python-discord/bot/issues/478
-rw-r--r--bot/cogs/alias.py8
-rw-r--r--bot/cogs/site.py27
2 files changed, 28 insertions, 7 deletions
diff --git a/bot/cogs/alias.py b/bot/cogs/alias.py
index 80ff37983..0df5498a1 100644
--- a/bot/cogs/alias.py
+++ b/bot/cogs/alias.py
@@ -53,6 +53,14 @@ class Alias (Cog):
"""Alias for invoking <prefix>site resources."""
await self.invoke(ctx, "site resources")
+ @command(name="tools", hidden=True)
+ async def site_tools_alias(self, ctx):
+ """
+ Alias for invoking <prefix>site tools.
+ """
+
+ await self.invoke(ctx, "site tools")
+
@command(name="watch", hidden=True)
async def bigbrother_watch_alias(self, ctx: Context, user: Union[Member, User, proxy_user], *, reason: str) -> None:
"""Alias for invoking <prefix>bigbrother watch [user] [reason]."""
diff --git a/bot/cogs/site.py b/bot/cogs/site.py
index 4a423faa9..8a8fed575 100644
--- a/bot/cogs/site.py
+++ b/bot/cogs/site.py
@@ -44,17 +44,30 @@ class Site(Cog):
async def site_resources(self, ctx: Context) -> None:
"""Info about the site's Resources page."""
learning_url = f"{PAGES_URL}/resources"
- tools_url = f"{PAGES_URL}/tools"
- embed = Embed(title="Resources & Tools")
- embed.set_footer(text=f"{learning_url} | {tools_url}")
+ embed = Embed(title="Resources")
+ embed.set_footer(text=f"{learning_url}")
embed.colour = Colour.blurple()
embed.description = (
f"The [Resources page]({learning_url}) on our website contains a "
- "list of hand-selected goodies that we regularly recommend "
- f"to both beginners and experts. The [Tools page]({tools_url}) "
- "contains a couple of the most popular tools for programming in "
- "Python."
+ "list of hand-selected learning resources that we regularly recommend "
+ f"to both beginners and experts."
+ )
+
+ await ctx.send(embed=embed)
+
+ @site_group.command(name="tools")
+ async def site_tools(self, ctx: Context):
+ """Info about the site's Tools page."""
+
+ tools_url = f"{PAGES_URL}/tools"
+
+ embed = Embed(title="Tools")
+ embed.set_footer(text=f"{tools_url}")
+ embed.colour = Colour.blurple()
+ embed.description = (
+ f"The [Tools page]({tools_url}) on our website contains a "
+ f"couple of the most popular tools for programming in Python."
)
await ctx.send(embed=embed)