T
T
temka_32020-12-04 23:55:05
Python
temka_3, 2020-12-04 23:55:05

What if after replacing message.content with message.content.startswith it stopped working?

import discord

client = discord.Client()

@client.event
async def on_message(message):
if str(message.channel) == "fludilka" and message.content.startswith == "-play":
await message.channel. purge(limit=1)


client.run('---') The

bot worked with message.content, but this option does not suit me, I found that you can write message.content.startswith, but it stopped working with it altogether

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-12-04
@temka_3

Because startswith is a string method: https://pythonz.net/references/named/str.startswith/
And it is used as a method, not like yours

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question