Home>
I want that if the author's messages are above the bot role, then the event will not work accordingly, how can I do this? Here is my code:
async def on_message(message):
if message.author== bot.user:
return
if message.author.top_role != bot.user:
return
elif message.content.startswith("text"):
channel= message.channel
await message.channel.send(f"{message.author.mention} text")
await message.delete()
await bot.process_commands(message)
yes, I already made the code, it works, but in one server for some reason member is taken as user, although the channel is not private, probably the server is private or I don’t know, in another server where I am an admin, not a user, then everything works.
mafinpy2022-02-14 10:34:36Related questions
- python : The bot does not find the command
- python : Instead of one line, everything is deleted!
- python : Developing Discord Bots with discord.py
- python : Yo. In general, I decided to learn how to create bots for discord, but there was one tiny problem, I can’t install
- python : bot ignores arguments
- Can't start python discord bot
- python : How to make a discord bot send a message to the chat every 10 seconds?
- python : Discord bot won't start
- Retrieve user in Discord not working
You seem to have written in the comments under the answer to the previous question that this issue has already been resolved for you. In this case, you can write and accept the answer yourself.
denisnumb2022-02-15 10:30:12