hebdobot/hooks/hello.py

23 lines
628 B
Python
Raw Normal View History

2024-01-11 08:17:25 +01:00
import logger
class Hello:
def process(self, bot, channel, sender, message):
"""
Le message est pris en compte si l'utilisateur salue le bot.
"""
if message.lower() in ("!salut", "!bonjour", "!hello") or (
bot.nickname.lower() in message.lower()
and any(
[
word in message.lower()
for word in ("bonjour", "salut", "hello", "yo", "hey", "hi")
]
)
):
logger.info("!hello caught.")
bot.send(channel, f"{sender}, bonjour \\o/")
2024-01-11 08:17:25 +01:00
return True