You're modifying message.content
before you pass it to process_commands
; specifically, you're removing all the spaces. Of course none of your command names are going to be matched against a giant, single-word string.
Don't directly modify message.content
. Since you're checking with in
, you don't even need to remove the spaces. Your conditional can also be simplified.
Moreover, as effprime pointed out, if you're going to delete offending messages it doesn't make sense to try to process any commands from them. So you need to either delete the message or process commands from it, not both.
bad_words = ['example1', 'example2', 'example3', 'example4']
if any(word in message.content.lower() for word in bad_words):
await message.delete()
...
else:
await client.process_commands(message)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…