[docs]asyncdefprocess_commands(self,message:discord.Message,/):""" Same as base method, but dispatches an additional event for cogs which want to handle normal messages differently to command messages, without the overhead of additional get_context calls per cog. """ifnotmessage.author.bot:ctx=awaitself.get_context(message,cls=PyLavContext)ifctx.invoked_withandisinstance(message.channel,discord.PartialMessageable):RED_LOGGER.warning("Discarded a command message (ID: %s) with PartialMessageable channel: %r",message.id,message.channel,)else:awaitself.invoke(ctx)else:ctx=NoneifctxisNoneorctx.validisFalse:self.dispatch("message_without_command",message)
[docs]asyncdefget_context(self:DISCORD_BOT_TYPE,message:discord.Message|DISCORD_INTERACTION_TYPE,/,*,cls=PyLavContext)->PyLavContext:"""Get the context for a command invocation."""returnawaitsuper(self.__class__,self).get_context(message,cls=cls)# noqa