aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/constants.py6
-rw-r--r--bot/exts/info/information.py8
-rw-r--r--tests/bot/exts/info/test_information.py9
3 files changed, 10 insertions, 13 deletions
diff --git a/bot/constants.py b/bot/constants.py
index 68a96876f..b1d392822 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -774,3 +774,9 @@ ERROR_REPLIES = [
"Noooooo!!",
"I can't believe you've done this",
]
+
+DEFAULT_RULES_DESCRIPTION = (
+ "The rules and guidelines that apply to this community can be found on"
+ " our [rules page](https://www.pythondiscord.com/pages/rules). We expect"
+ " all members of the community to have read and understood these."
+)
diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py
index d4f0ce008..a4816450f 100644
--- a/bot/exts/info/information.py
+++ b/bot/exts/info/information.py
@@ -13,6 +13,7 @@ from discord.utils import escape_markdown
from bot import constants
from bot.bot import Bot
+from bot.constants import DEFAULT_RULES_DESCRIPTION
from bot.converters import MemberOrUser
from bot.decorators import in_whitelist
from bot.errors import NonExistentRoleError
@@ -545,12 +546,7 @@ class Information(Cog):
if not rule_numbers and not keywords:
# Neither rules nor keywords were submitted. Return the default description.
- rules_embed.description = (
- "The rules and guidelines that apply to this community can be found on"
- " our [rules page](https://www.pythondiscord.com/pages/rules). We expect"
- " all members of the community to have read and understood these."
- )
-
+ rules_embed.description = DEFAULT_RULES_DESCRIPTION
await ctx.send(embed=rules_embed)
return
diff --git a/tests/bot/exts/info/test_information.py b/tests/bot/exts/info/test_information.py
index 626c12c86..c0cfac430 100644
--- a/tests/bot/exts/info/test_information.py
+++ b/tests/bot/exts/info/test_information.py
@@ -7,6 +7,7 @@ from textwrap import shorten
import discord
from bot import constants
+from bot.constants import DEFAULT_RULES_DESCRIPTION
from bot.exts.info import information
from bot.utils.checks import InWhitelistCheckFailure
from tests import helpers
@@ -639,14 +640,8 @@ class RuleCommandTests(unittest.IsolatedAsyncioTestCase):
(("hello", "999"), None),
]
- description = (
- "The rules and guidelines that apply to this community can be found on"
- " our [rules page](https://www.pythondiscord.com/pages/rules). We expect"
- " all members of the community to have read and understood these."
- )
-
for raw_user_input, expected_matched_rule_numbers in test_cases:
final_rule_numbers = await self.cog.rules(self.cog, self.ctx, *raw_user_input)
embed = self.ctx.send.call_args.kwargs['embed']
- self.assertEqual(description, embed.description)
+ self.assertEqual(DEFAULT_RULES_DESCRIPTION, embed.description)
self.assertEqual(expected_matched_rule_numbers, final_rule_numbers)