diff options
| author | 2018-10-29 20:08:00 +0000 | |
|---|---|---|
| committer | 2018-10-29 20:08:00 +0000 | |
| commit | 88e57c3d8fd4f296eed27262c58cf1a26962cddf (patch) | |
| tree | c302fea47b0ad07f2fcc179bd48808d4bdd1cb33 | |
| parent | Merge branch 'aliascog' into 'master' (diff) | |
| parent | Added site command and alias for rules. (diff) | |
Merge branch 'juanita/rules-command' into 'master'
Added site command and alias for rules.
See merge request python-discord/projects/bot!80
| -rw-r--r-- | bot/cogs/alias.py | 8 | ||||
| -rw-r--r-- | bot/cogs/site.py | 16 |
2 files changed, 24 insertions, 0 deletions
diff --git a/bot/cogs/alias.py b/bot/cogs/alias.py index 940bdaa43..7b342a2d0 100644 --- a/bot/cogs/alias.py +++ b/bot/cogs/alias.py @@ -85,6 +85,14 @@ class Alias: await self.invoke(ctx, "site faq") + @command(name="rules", hidden=True) + async def site_rules_alias(self, ctx): + """ + Alias for invoking <prefix>site rules. + """ + + await self.invoke(ctx, "site rules") + @command(name="reload", hidden=True) async def reload_cog_alias(self, ctx, *, cog_name: str): """ diff --git a/bot/cogs/site.py b/bot/cogs/site.py index e5fd645fb..442e80cd2 100644 --- a/bot/cogs/site.py +++ b/bot/cogs/site.py @@ -92,6 +92,22 @@ class Site: await ctx.send(embed=embed) + @site_group.command(name="rules") + async def site_rules(self, ctx: Context): + """Info about the server's rules.""" + + url = f"{URLs.site_schema}{URLs.site}/about/rules" + + embed = Embed(title="Rules") + embed.set_footer(text=url) + embed.colour = Colour.blurple() + embed.description = ( + f"The rules and guidelines that apply to this community can be found on our [rules page]({url}). " + "We expect all members of the community to have read and understood these." + ) + + await ctx.send(embed=embed) + def setup(bot): bot.add_cog(Site(bot)) |