The class messagecontains information about the message author, which you can use to determine whether to reply to the message. authoris an Memberobject (or its superclass Userif the channel is private) that has a property idbut also supports direct logical comparisons between users.
For instance:
@bot.event
async def on_message(message):
if message.author != bot.user:
await bot.send_message(message.channel, message.content)
Must function as desired
source
share