Reputation: 103
@bot.event
async def on_message(message):
if '!' in message.content:
return
if message.content.startswith(muti):
await asyncio.sleep(3)
await message.delete()
else:
await message.delete()
await message.channel.send(muti)
if message.author.bot:
return
I am trying to create an exception where my bot will not delete another bot's message, but I don't know how to do it. I tried to use if message.author.(the other bot's id variable) but then I don't know how to set that variable up. The message.author.bot is for my bot to ignore its own messages.
Upvotes: 2
Views: 43
Reputation: 1829
Using member.bot
which returns if the member is a bot documentation.
@bot.event
async def on_message(message):
if message.author.bot:
return
if '!' in message.content:
return
if message.content.startswith(muti):
await asyncio.sleep(3)
await message.delete()
else:
await message.delete()
await message.channel.send(muti)
if message.author.bot:
return
This will not execute any of the code below if the message was sent by a bot.
Upvotes: 1