aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-04-20 21:02:57 +0100
committerGravatar Chris Lovering <[email protected]>2022-04-20 21:02:57 +0100
commit0a799bb9c3ff17d7eea16710c9eb20fcd981346a (patch)
tree2b62cb7eda3ced0734e8f8b8352280cc1ac25ae9
parentPass the now required intents kwarg when creating MockBot (diff)
Don't hardcode ! as the bot prefix where possible
-rw-r--r--bot/exts/filters/filtering.py4
-rw-r--r--bot/exts/fun/off_topic_names.py4
-rw-r--r--bot/exts/help_channels/_message.py2
-rw-r--r--bot/exts/moderation/voice_gate.py8
-rw-r--r--bot/exts/recruitment/talentpool/_cog.py4
-rw-r--r--bot/exts/utils/bot.py7
6 files changed, 16 insertions, 13 deletions
diff --git a/bot/exts/filters/filtering.py b/bot/exts/filters/filtering.py
index 6982f5948..21c155902 100644
--- a/bot/exts/filters/filtering.py
+++ b/bot/exts/filters/filtering.py
@@ -18,7 +18,7 @@ from discord.ext.commands import Cog
from discord.utils import escape_markdown
from bot.bot import Bot
-from bot.constants import Channels, Colours, Filter, Guild, Icons, URLs
+from bot.constants import Bot as BotConfig, Channels, Colours, Filter, Guild, Icons, URLs
from bot.exts.events.code_jams._channels import CATEGORY_NAME as JAM_CATEGORY_NAME
from bot.exts.moderation.modlog import ModLog
from bot.log import get_logger
@@ -434,7 +434,7 @@ class Filtering(Cog):
ping_everyone = False
content = None
- eval_msg = "using !eval " if is_eval else ""
+ eval_msg = f"using {BotConfig.prefix}eval " if is_eval else ""
footer = f"Reason: {reason}" if reason else None
message = (
f"The {filter_name} {_filter['type']} was triggered by {format_user(msg.author)} "
diff --git a/bot/exts/fun/off_topic_names.py b/bot/exts/fun/off_topic_names.py
index 85dbdd641..35cc3dcb5 100644
--- a/bot/exts/fun/off_topic_names.py
+++ b/bot/exts/fun/off_topic_names.py
@@ -7,7 +7,7 @@ from discord.ext import tasks
from discord.ext.commands import Cog, Context, group, has_any_role
from bot.bot import Bot
-from bot.constants import Channels, MODERATION_ROLES
+from bot.constants import Bot as BotConfig, Channels, MODERATION_ROLES
from bot.converters import OffTopicName
from bot.log import get_logger
from bot.pagination import LinePaginator
@@ -82,7 +82,7 @@ class OffTopicNames(Cog):
)
await ctx.send(
f":x: The channel name `{name}` is too similar to `{match}`, and thus was not added. "
- "Use `!otn forceadd` to override this check."
+ f"Use `{BotConfig.prefix}otn forceadd` to override this check."
)
else:
await self._add_name(ctx, name)
diff --git a/bot/exts/help_channels/_message.py b/bot/exts/help_channels/_message.py
index b79697f73..8eb4ec311 100644
--- a/bot/exts/help_channels/_message.py
+++ b/bot/exts/help_channels/_message.py
@@ -27,7 +27,7 @@ For more tips, check out our guide on [asking good questions]({ASKING_GUIDE_URL}
AVAILABLE_TITLE = "Available help channel"
-AVAILABLE_FOOTER = "Closes after a period of inactivity, or when you send !close."
+AVAILABLE_FOOTER = f"Closes after a period of inactivity, or when you send {constants.Bot.prefix}close."
DORMANT_MSG = f"""
This help channel has been marked as **dormant**, and has been moved into the **{{dormant}}** \
diff --git a/bot/exts/moderation/voice_gate.py b/bot/exts/moderation/voice_gate.py
index 9b1621c01..90f88d040 100644
--- a/bot/exts/moderation/voice_gate.py
+++ b/bot/exts/moderation/voice_gate.py
@@ -10,7 +10,7 @@ from discord import Colour, Member, VoiceState
from discord.ext.commands import Cog, Context, command
from bot.bot import Bot
-from bot.constants import Channels, MODERATION_ROLES, Roles, VoiceGate as GateConf
+from bot.constants import Bot as BotConfig, Channels, MODERATION_ROLES, Roles, VoiceGate as GateConf
from bot.decorators import has_no_roles, in_whitelist
from bot.exts.moderation.modlog import ModLog
from bot.log import get_logger
@@ -37,14 +37,14 @@ MESSAGE_FIELD_MAP = {
VOICE_PING = (
"Wondering why you can't talk in the voice channels? "
- "Use the `!voiceverify` command in here to verify. "
+ f"Use the `{BotConfig.prefix}voiceverify` command in here to verify. "
"If you don't yet qualify, you'll be told why!"
)
VOICE_PING_DM = (
"Wondering why you can't talk in the voice channels? "
- "Use the `!voiceverify` command in {channel_mention} to verify. "
- "If you don't yet qualify, you'll be told why!"
+ f"Use the `{BotConfig.prefix}voiceverify` command in "
+ "{channel_mention} to verify. If you don't yet qualify, you'll be told why!"
)
diff --git a/bot/exts/recruitment/talentpool/_cog.py b/bot/exts/recruitment/talentpool/_cog.py
index 24496af54..ef3236393 100644
--- a/bot/exts/recruitment/talentpool/_cog.py
+++ b/bot/exts/recruitment/talentpool/_cog.py
@@ -11,7 +11,7 @@ from discord import Color, Embed, Member, PartialMessage, RawReactionActionEvent
from discord.ext.commands import BadArgument, Cog, Context, group, has_any_role
from bot.bot import Bot
-from bot.constants import Channels, Emojis, Guild, MODERATION_ROLES, Roles, STAFF_ROLES
+from bot.constants import Bot as BotConfig, Channels, Emojis, Guild, MODERATION_ROLES, Roles, STAFF_ROLES
from bot.converters import MemberOrUser, UnambiguousMemberOrUser
from bot.exts.recruitment.talentpool._review import Reviewer
from bot.log import get_logger
@@ -237,7 +237,7 @@ class TalentPool(Cog, name="Talentpool"):
if any(role.id in MODERATION_ROLES for role in ctx.author.roles):
await ctx.send(
f":x: Nominations should be run in the <#{Channels.nominations}> channel. "
- "Use `!tp forcenominate` to override this check."
+ f"Use `{BotConfig.prefix}tp forcenominate` to override this check."
)
else:
await ctx.send(f":x: Nominations must be run in the <#{Channels.nominations}> channel")
diff --git a/bot/exts/utils/bot.py b/bot/exts/utils/bot.py
index 721ae9dcb..a312e0584 100644
--- a/bot/exts/utils/bot.py
+++ b/bot/exts/utils/bot.py
@@ -4,7 +4,7 @@ from discord import Embed, TextChannel
from discord.ext.commands import Cog, Context, command, group, has_any_role
from bot.bot import Bot
-from bot.constants import Guild, MODERATION_ROLES, URLs
+from bot.constants import Bot as BotConfig, Guild, MODERATION_ROLES, URLs
from bot.log import get_logger
log = get_logger(__name__)
@@ -25,7 +25,10 @@ class BotCog(Cog, name="Bot"):
async def about_command(self, ctx: Context) -> None:
"""Get information about the bot."""
embed = Embed(
- description="A utility bot designed just for the Python server! Try `!help` for more info.",
+ description=(
+ "A utility bot designed just for the Python server! "
+ f"Try `{BotConfig.prefix}help` for more info."
+ ),
url="https://github.com/python-discord/bot"
)