aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar (PC) Refisio <[email protected]>2019-02-09 22:24:07 -0500
committerGravatar (PC) Refisio <[email protected]>2019-02-09 22:24:07 -0500
commit32f5ceeae2f4c9c1c4c9c140945ad28743ce2222 (patch)
tree63d2e894c210a3c604ffa3455fda20e7d5b96eb3
parentUpdated Rules cog. (diff)
Updated Rules cog.
-rw-r--r--bot/cogs/rules.py20
-rw-r--r--tox.ini2
2 files changed, 10 insertions, 12 deletions
diff --git a/bot/cogs/rules.py b/bot/cogs/rules.py
index 7582e8c80..666f7b1b6 100644
--- a/bot/cogs/rules.py
+++ b/bot/cogs/rules.py
@@ -1,13 +1,13 @@
import re
from typing import Optional
-from bot.constants import Channels, Roles
-from bot.decorators import redirect_output
-from bot.pagination import LinePaginator
-
from discord import Colour, Embed
from discord.ext.commands import Bot, Context, command
+from bot.pagination import LinePaginator
+from bot.constants import Channels, Roles
+from bot.decorators import redirect_output
+
STAFF = Roles.admin, Roles.moderator, Roles.owner
@@ -51,11 +51,10 @@ class Rules:
"We do not allow advertisements for communities (including other Discord servers) or "
"commercial projects - Contact us directly if you want to discuss a partnership!"
)
- self.default_desc = "The rules and guidelines that apply to this " \
- "community can be found on our [rules page]" \
- "(https://pythondiscord.com/about/rules). We " \
- "expect all members of the community to have " \
- "read and understood these."
+ self.default_desc = ("The rules and guidelines that apply to this community can be found on"
+ " our [rules page](https://pythondiscord.com/about/rules). We expect"
+ " all members of the community to have read and understood these."
+ )
@command(aliases=['r', 'rule'], name='rules')
@redirect_output(destination_channel=Channels.bot, bypass_roles=STAFF)
@@ -85,8 +84,7 @@ class Rules:
continue
rule_match = re.search(r'\d?\d[:|-]1?\d', item)
if rule_match:
- a, b = sorted(
- [int(x)-1 for x in re.split(r'[:-]', rule_match.group())])
+ a, b = sorted([int(x)-1 for x in re.split(r'[:-]', rule_match.group())])
rules_to_get.extend(range(a, b+1))
else:
rules_to_get.append(int(item)-1)
diff --git a/tox.ini b/tox.ini
index c6fa513f4..67f0ffd81 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[flake8]
-max-line-length=120
+max-line-length=100
application_import_names=bot
exclude=.cache,.venv
ignore=B311,W503,E226,S311