mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
Fix [p]cleanup bot (#1205)
This commit is contained in:
parent
f1a20e1677
commit
e18f94c17d
@ -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]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user