[Core] Utilize clean prefix (#3579)

* [core] use clean prefix

* forgot an import
This commit is contained in:
zephyrkul 2020-02-20 10:58:41 -07:00 committed by GitHub
parent 6779a76b68
commit e70fcef651
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import importlib
import itertools import itertools
import logging import logging
import os import os
import re
import sys import sys
import platform import platform
import getpass import getpass
@ -540,7 +541,7 @@ class Core(commands.Cog, CoreLogic):
await ctx.send( await ctx.send(
"You're about to make the `{0}invite` command public. " "You're about to make the `{0}invite` command public. "
"All users will be able to invite me on their server.\n\n" "All users will be able to invite me on their server.\n\n"
"If you agree, you can type `{0}inviteset public yes`.".format(ctx.prefix) "If you agree, you can type `{0}inviteset public yes`.".format(ctx.clean_prefix)
) )
else: else:
await self.bot._config.invite_public.set(True) await self.bot._config.invite_public.set(True)
@ -1193,7 +1194,7 @@ class Core(commands.Cog, CoreLogic):
"only do it up to 2 times an hour. Use " "only do it up to 2 times an hour. Use "
"nicknames if you need frequent changes. " "nicknames if you need frequent changes. "
"`{}set nickname`" "`{}set nickname`"
).format(ctx.prefix) ).format(ctx.clean_prefix)
) )
else: else:
await ctx.send(_("Done.")) await ctx.send(_("Done."))
@ -1255,7 +1256,7 @@ class Core(commands.Cog, CoreLogic):
_( _(
"Invalid locale. Use `{prefix}listlocales` to get " "Invalid locale. Use `{prefix}listlocales` to get "
"a list of available locales." "a list of available locales."
).format(prefix=ctx.prefix) ).format(prefix=ctx.clean_prefix)
) )
@_set.command() @_set.command()
@ -1503,7 +1504,7 @@ class Core(commands.Cog, CoreLogic):
# source. So we'll just mock a DM message instead. # source. So we'll just mock a DM message instead.
fake_message = namedtuple("Message", "guild") fake_message = namedtuple("Message", "guild")
prefixes = await ctx.bot.command_prefix(ctx.bot, fake_message(guild=None)) prefixes = await ctx.bot.command_prefix(ctx.bot, fake_message(guild=None))
prefix = prefixes[0] prefix = re.sub(rf"<@!?{ctx.me.id}>", f"@{ctx.me.name}", prefixes[0])
content = _("Use `{}dm {} <text>` to reply to this user").format(prefix, author.id) content = _("Use `{}dm {} <text>` to reply to this user").format(prefix, author.id)
@ -1609,7 +1610,7 @@ class Core(commands.Cog, CoreLogic):
fake_message = namedtuple("Message", "guild") fake_message = namedtuple("Message", "guild")
prefixes = await ctx.bot.command_prefix(ctx.bot, fake_message(guild=None)) prefixes = await ctx.bot.command_prefix(ctx.bot, fake_message(guild=None))
prefix = prefixes[0] prefix = re.sub(rf"<@!?{ctx.me.id}>", f"@{ctx.me.name}", prefixes[0])
description = _("Owner of {}").format(ctx.bot.user) description = _("Owner of {}").format(ctx.bot.user)
content = _("You can reply to this message with {}contact").format(prefix) content = _("You can reply to this message with {}contact").format(prefix)
if await ctx.embed_requested(): if await ctx.embed_requested():