aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2021-04-19 22:18:41 +0200
committerGravatar Numerlor <[email protected]>2021-12-08 15:35:30 +0100
commitfc84bcfb3ae749248e47aa805a40558ac678647b (patch)
tree0f9f4e9fb758ddeaa66b0d28312c514d360740e8
parentRemove the site help command (diff)
Move static content site commands to tags and remove the site cog
-rw-r--r--bot/exts/info/site.py94
-rw-r--r--bot/resources/tags/faq.md6
-rw-r--r--bot/resources/tags/resources.md6
-rw-r--r--bot/resources/tags/site.md6
-rw-r--r--bot/resources/tags/tools.md6
5 files changed, 24 insertions, 94 deletions
diff --git a/bot/exts/info/site.py b/bot/exts/info/site.py
deleted file mode 100644
index 4b0b7649d..000000000
--- a/bot/exts/info/site.py
+++ /dev/null
@@ -1,94 +0,0 @@
-from textwrap import shorten
-
-from discord import Colour, Embed
-from discord.ext.commands import Cog, Context, group
-
-from bot.bot import Bot
-from bot.constants import URLs
-from bot.log import get_logger
-
-log = get_logger(__name__)
-
-BASE_URL = f"{URLs.site_schema}{URLs.site}"
-
-
-class Site(Cog):
- """Commands for linking to different parts of the site."""
-
- def __init__(self, bot: Bot):
- self.bot = bot
-
- @group(name="site", aliases=("s",), invoke_without_command=True)
- async def site_group(self, ctx: Context) -> None:
- """Commands for getting info about our website."""
- await ctx.send_help(ctx.command)
-
- @site_group.command(name="home", aliases=("about",), root_aliases=("home",))
- async def site_main(self, ctx: Context) -> None:
- """Info about the website itself."""
- url = f"{URLs.site_schema}{URLs.site}/"
-
- embed = Embed(title="Python Discord website")
- embed.set_footer(text=url)
- embed.colour = Colour.og_blurple()
- embed.description = (
- f"[Our official website]({url}) is an open-source community project "
- "created with Python and Django. It contains information about the server "
- "itself, lets you sign up for upcoming events, has its own wiki, contains "
- "a list of valuable learning resources, and much more."
- )
-
- await ctx.send(embed=embed)
-
- @site_group.command(name="resources", root_aliases=("resources", "resource"))
- async def site_resources(self, ctx: Context) -> None:
- """Info about the site's Resources page."""
- learning_url = f"{BASE_URL}/resources"
-
- embed = Embed(title="Resources")
- embed.set_footer(text=f"{learning_url}")
- embed.colour = Colour.og_blurple()
- embed.description = (
- f"The [Resources page]({learning_url}) on our website contains a "
- "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", root_aliases=("tools",))
- async def site_tools(self, ctx: Context) -> None:
- """Info about the site's Tools page."""
- tools_url = f"{BASE_URL}/resources/tools"
-
- embed = Embed(title="Tools")
- embed.set_footer(text=f"{tools_url}")
- embed.colour = Colour.og_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)
-
- @site_group.command(name="faq", root_aliases=("faq",))
- async def site_faq(self, ctx: Context) -> None:
- """Info about the site's FAQ page."""
- url = f"{BASE_URL}/pages/frequently-asked-questions"
-
- embed = Embed(title="FAQ")
- embed.set_footer(text=url)
- embed.colour = Colour.og_blurple()
- embed.description = (
- "As the largest Python community on Discord, we get hundreds of questions every day. "
- "Many of these questions have been asked before. We've compiled a list of the most "
- "frequently asked questions along with their answers, which can be found on "
- f"our [FAQ page]({url})."
- )
-
- await ctx.send(embed=embed)
-
-
-def setup(bot: Bot) -> None:
- """Load the Site cog."""
- bot.add_cog(Site(bot))
diff --git a/bot/resources/tags/faq.md b/bot/resources/tags/faq.md
new file mode 100644
index 000000000..e1c57b3a0
--- /dev/null
+++ b/bot/resources/tags/faq.md
@@ -0,0 +1,6 @@
+---
+embed:
+ title: "Frequently asked questions"
+---
+
+As the largest Python community on Discord, we get hundreds of questions every day. Many of these questions have been asked before. We've compiled a list of the most frequently asked questions along with their answers, which can be found on our [FAQ page](https://www.pythondiscord.com/pages/frequently-asked-questions/).
diff --git a/bot/resources/tags/resources.md b/bot/resources/tags/resources.md
new file mode 100644
index 000000000..201e0eb1e
--- /dev/null
+++ b/bot/resources/tags/resources.md
@@ -0,0 +1,6 @@
+---
+embed:
+ title: "Resources"
+---
+
+The [Resources page](https://www.pythondiscord.com/resources/) on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
diff --git a/bot/resources/tags/site.md b/bot/resources/tags/site.md
new file mode 100644
index 000000000..376f84742
--- /dev/null
+++ b/bot/resources/tags/site.md
@@ -0,0 +1,6 @@
+---
+embed:
+ title: "Python Discord Website"
+---
+
+[Our official website](https://www.pythondiscord.com/) is an open-source community project created with Python and Django. It contains information about the server itself, lets you sign up for upcoming events, has its own wiki, contains a list of valuable learning resources, and much more.
diff --git a/bot/resources/tags/tools.md b/bot/resources/tags/tools.md
new file mode 100644
index 000000000..3cae75552
--- /dev/null
+++ b/bot/resources/tags/tools.md
@@ -0,0 +1,6 @@
+---
+embed:
+ title: "Tools"
+---
+
+The [Tools page](https://www.pythondiscord.com/resources/tools/) on our website contains a couple of the most popular tools for programming in Python.