Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Google it! This is shown in Quick Start in the discord.py docks.
# вместо client.event может быть bot.event, смотря как названа переменная с объектом бота
@client.event
async def on_message(message):
# отсеиваем сообщения, которые отправили мы сами
if message.author == client.user:
return
# а вот тут мы проверяем содержимое сообщения. Это пример.
# Реальную логику проверки, разумеется, пишешь самостоятельно, под свои нужды.
if message.content.startswith('$hello'):
await message.channel.send('Hello!')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question