if (self.only_speak_when_spoken_to and client.user.mentioned_in(message) \
or any(word in message.content.lower() for word in client.user.display_name.lower().split())) \
or (self.in_active_conversation(message.author.id) and message.channel.id == self.main_channel):
""" If bot is set to only speak when spoken to and someone uses its name
or if is in an active conversation with the user in the main channel, we reply.
This is a messy one. """
Probably in this part of the code: