HelloThere = ["Hello There", "Hello there", "hello there"]
for word in HelloThere:
if (message.content.lower().count(word) > 0) and (message.author.id != 712885407993561169):
await message.channel.send("General Kenobi")
I am trying to test to see if a string contains a certain key phrase. If the string contains something like, "Why Hello THeRe" then it must satisfy the if statement.
The code returns General Kenobi correctly, however, I want to have good code practice and do not understand why the list of words (HelloThere = ["Hello There", "Hello there", "hello there"]) only works when it's in this certain order and number. If for example I just have it as Hello There = ["Hello There"] and test for that, it won't work.
HelloThereis alistwhile in the latter it's astr. Thefor ... inloop will obviously work differently in each case.