From 901c4f7b8017b76583dcc1f0b462c54f635be949 Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Fri, 21 Feb 2020 04:25:37 +0100 Subject: [PATCH] Update core_commands.py (#3585) --- redbot/core/core_commands.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index da5a67bfb..cbb561ffd 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -1499,11 +1499,7 @@ class Core(commands.Cog, CoreLogic): source = _("from {}").format(guild) footer += _(" | Server ID: {}").format(guild.id) - # We need to grab the DM command prefix (global) - # Since it can also be set through cli flags, bot._config is not a reliable - # source. So we'll just mock a DM message instead. - fake_message = namedtuple("Message", "guild") - prefixes = await ctx.bot.command_prefix(ctx.bot, fake_message(guild=None)) + prefixes = await ctx.bot.get_valid_prefixes() prefix = re.sub(rf"<@!?{ctx.me.id}>", f"@{ctx.me.name}", prefixes[0]) content = _("Use `{}dm {} ` to reply to this user").format(prefix, author.id) @@ -1608,8 +1604,7 @@ class Core(commands.Cog, CoreLogic): ) return - fake_message = namedtuple("Message", "guild") - prefixes = await ctx.bot.command_prefix(ctx.bot, fake_message(guild=None)) + prefixes = await ctx.bot.get_valid_prefixes() prefix = re.sub(rf"<@!?{ctx.me.id}>", f"@{ctx.me.name}", prefixes[0]) description = _("Owner of {}").format(ctx.bot.user) content = _("You can reply to this message with {}contact").format(prefix)