Modify CustomCommands to use on_message_without_command (#3811)

This commit is contained in:
Michael H 2020-05-01 12:30:32 -04:00 committed by GitHub
parent 0c94ce6cc3
commit d5c960096e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -498,7 +498,7 @@ class CustomCommands(commands.Cog):
await ctx.send(box(p, lang="yaml")) await ctx.send(box(p, lang="yaml"))
@commands.Cog.listener() @commands.Cog.listener()
async def on_message(self, message): async def on_message_without_command(self, message):
is_private = isinstance(message.channel, discord.abc.PrivateChannel) is_private = isinstance(message.channel, discord.abc.PrivateChannel)
# user_allowed check, will be replaced with self.bot.user_allowed or # user_allowed check, will be replaced with self.bot.user_allowed or
@ -510,7 +510,7 @@ class CustomCommands(commands.Cog):
ctx = await self.bot.get_context(message) ctx = await self.bot.get_context(message)
if ctx.prefix is None or ctx.valid: if ctx.prefix is None:
return return
try: try: