GLaDOS/glados_cmnds.py

47 lines
1.2 KiB
Python

from irc_api import api
from random import choice
@api.on(lambda m: "au revoir glados" in m.text.lower())
def greetings_bye(bot, msg, *args):
bot.send(msg.to, f"Au revoir {msg.author}")
@api.channel("#glados")
@api.on(
event=lambda m: "bonjour glados" in m.text.lower(),
desc="Réagis au 'bonjour glados' uniquement si le message est envoyé depuis le channel "\
"#glados."
)
def greetings_hello(bot, msg, *args):
bot.send(msg.to, args)
bot.send(msg.to, f"Oh un utilisateur sur #glados :o")
@api.command("test")
def test(bot, msg, *args):
"""Test de module de fonction."""
bot.send(msg.to, f"arguments : {args}")
@api.channel("#glados")
def react_on_glados(bot, msg, *args):
"""Répond de manière random à tout les messages posté sur #glados."""
answers = (
f"Yo {msg.author} o/",
"Alors, de quoi on parle ?",
"Ça va ?",
"Bon, tu as fini de spammer ou bien ?",
"Ça roule ?",
"Hey you! Ah, you finally awake…",
)
bot.send(msg.to, choice(answers))
commands = [
api.auto_help,
greetings_bye,
greetings_hello,
test,
# react_on_glados
]