Почему message.content.startswith не работает? [закрыто]Python

Программы на Python
Anonymous
Почему message.content.startswith не работает? [закрыто]

Сообщение Anonymous »

Я пытался заставить этот код работать, но он не работал. Я не знаю, как заставить это работать.
Весь мой код:

Код: Выделить всё

import discord

intents = discord.Intents.default()
client = discord.Client(intents = intents)
intents.members = True
intents.messages = True

@client.event
async def on_ready():
print(f'We have logged in as {client.user}')

@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('$hello'):
print("testing")
await message.channel.send('Hello!')
Пытаемся обнаружить его при произнесении «$hello» и ответить «Привет»

Подробнее здесь: https://stackoverflow.com/questions/777 ... swith-work

Вернуться в «Python»