i want to make the user type !join to join in a game but delete all messages in it so it doesn't get full. But when i do this it deletes all the messages in that channel, but it breaks all the other parts of the bot.
I tried await message.delete() and await message.channel.purge(limit=1).
@client.event
async def on_message(message):
channel = client.get_channel(590978944904331274)
if message.channel == channel:
await message.channel.purge(limit=1)
client.run(token)
it works but breaks the rest of the bot.