My code :
@commands.Cog.listener()
async def on_message(self, message):
if message.author.id == self.bot.user.id:
return
if message.channel.type == discord.ChannelType.private:
await message.channel.send("Vous devez être dans un serveur pour realiser cette commande !")
return
but it doesn't work, it's recognise that is was a private channel and it send the right message but it also process the command and send the answer ...