I coded a Textbot for discord, which recognizes words and gives answers. It have grown much bigger than I thought and I wanted to organize it in a dictionary insted of 200 if-else chains. How can I get the "word" for the dictionary parameter? It only says "unresolved reference "word"".
@commands.Cog.listener()
async def on_message(self, message):
if any(word in message.content.lower() for word in replace):
await message.channel.send(replace[word]["answer"])