N
N
Nolrox2021-12-22 19:07:27
Python
Nolrox, 2021-12-22 19:07:27

Is it possible to make the discord.py bot reply to a message in any way?

Is it possible to make the bot respond to the message "hello" also "hello", but so that he would answer it even if they wrote "HELLO"? If so, how?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alan Gibizov, 2021-12-22
@phaggi

I recommend using the .lower() method - to compare two string objects with this method applied to them.
print("привет".lower() == "пРиВЕт".lower())

B
Bogdan Nikolenko, 2021-12-23
@ayabondid

@bot.event
async def on_message(message)
if message.author != bot.user: await message.channel.send(message.content.lower())
else: return

K
Kolyte, 2022-02-23
@Kolyte

hello_words = ["hello", "hi", "hello", "privet", "hello"]
if len(list(set(msg_list + hello_words))) < len(msg_list) + len(hello_words(sad)
await message .channel.send('`Hello, what would you like?`')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question