diff --git a/redbot/cogs/cleanup/cleanup.py b/redbot/cogs/cleanup/cleanup.py index 67bb8b3d6..04ff18bcf 100644 --- a/redbot/cogs/cleanup/cleanup.py +++ b/redbot/cogs/cleanup/cleanup.py @@ -221,14 +221,9 @@ class Cleanup: author = ctx.message.author is_bot = self.bot.user.bot - prefixes = self.bot.command_prefix + prefixes = await self.bot.get_prefix(ctx.message) # This returns all server prefixes if isinstance(prefixes, str): prefixes = [prefixes] - elif callable(prefixes): - if asyncio.iscoroutine(prefixes): - await ctx.send(_('Coroutine prefixes not yet implemented.')) - return - prefixes = prefixes(self.bot, ctx.message) # In case some idiot sets a null prefix if '' in prefixes: @@ -241,7 +236,8 @@ class Cleanup: return True p = discord.utils.find(m.content.startswith, prefixes) if p and len(p) > 0: - return m.content[len(p):].startswith(tuple(self.bot.commands)) + cmd_name = m.content[len(p):].split(' ')[0] + return bool(self.bot.get_command(cmd_name)) return False to_delete = [ctx.message]