aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar refisio <[email protected]>2019-02-22 15:26:06 -0500
committerGravatar refisio <[email protected]>2019-02-22 15:26:06 -0500
commit97c30c0df64a02aa6ded6bc6e019fb3991667b22 (patch)
tree98ac37cf01ffa751ed33370653ef479f1780aff1
parentMerge branch 'master' into rules_command (diff)
Removed `STAFF` constant in favor of `STAFF_ROLES` constant, added footer pointing to the Rules Site page to the paginated embed.
-rw-r--r--bot/cogs/rules.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/bot/cogs/rules.py b/bot/cogs/rules.py
index eee506810..1284c34bc 100644
--- a/bot/cogs/rules.py
+++ b/bot/cogs/rules.py
@@ -4,12 +4,10 @@ from typing import Optional
from discord import Colour, Embed
from discord.ext.commands import Bot, Context, command
-from bot.constants import Channels, Roles
+from bot.constants import Channels, STAFF_ROLES
from bot.decorators import redirect_output
from bot.pagination import LinePaginator
-STAFF = Roles.admin, Roles.moderator, Roles.owner
-
class Rules:
@@ -54,9 +52,10 @@ class Rules:
" our [rules page](https://pythondiscord.com/about/rules). We expect"
" all members of the community to have read and understood these."
)
+ self.footer = 'https://pythondiscord.com/about/rules'
@command(aliases=['r', 'rule'], name='rules')
- @redirect_output(destination_channel=Channels.bot, bypass_roles=STAFF)
+ @redirect_output(destination_channel=Channels.bot, bypass_roles=STAFF_ROLES)
async def rules_command(self, ctx: Context, *, rules: Optional[str] = None):
"""
Provides a link to the `rules` endpoint of the website, or displays
@@ -66,7 +65,7 @@ class Rules:
**`rules`:** The rules a user wants to get.
"""
rules_embed = Embed(title='Rules', color=Colour.blurple())
- rules_embed.set_footer(text='https://pythondiscord.com/about/rules')
+ rules_embed.set_footer(text=self.footer)
if not rules:
# Rules were not submitted. Return the default description.
@@ -95,7 +94,8 @@ class Rules:
# No valid rules in rules input. Return the default description.
rules_embed.description = self.default_desc
return await ctx.send(embed=rules_embed)
- await LinePaginator.paginate(final_rules, ctx, rules_embed, max_lines=3)
+ await LinePaginator.paginate(final_rules, ctx, rules_embed, max_lines=3,
+ footer_text=self.footer)
def setup(bot):