@client.event
async def on_message(message):
await client.process_commands(message)
if message.content.startswith('sa'):
await message.channel.send('as')
This is my code. It should say as
when I say sa
. It works fine but when I write salah
or anything that starts with sa
, it detects it and responds. It shouldn't work like that. I read the documentation but couldn't find anything, I know that it is becuse of .startswith
but I can't find any replacement for it.
As explained in the comments, if you want to compare equality between strings, then:
if message.content == 'sa':
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With