2024-01-11 08:17:25 +01:00
|
|
|
import logger
|
|
|
|
|
|
|
|
|
|
|
|
class StopReview:
|
|
|
|
def process(self, bot, channel, sender, message):
|
|
|
|
"""
|
|
|
|
Si la commande est bonne, le bot abandonne la revue hebdomadaire en cours.
|
|
|
|
"""
|
|
|
|
if message.lower() in ("!stop"):
|
|
|
|
logger.info("!stop caught.")
|
|
|
|
|
|
|
|
if not bot.review.is_started:
|
|
|
|
bot.send(
|
|
|
|
channel,
|
|
|
|
f"{sender}, pas de revue en cours, abandon impossible.",
|
|
|
|
)
|
|
|
|
return True
|
|
|
|
|
|
|
|
if not bot.review.is_owner(sender):
|
|
|
|
bot.send(
|
|
|
|
channel,
|
|
|
|
f"{sender}, vous n'êtes pas responsable de la réunion.",
|
|
|
|
)
|
|
|
|
return True
|
|
|
|
|
|
|
|
bot.review.cancel()
|
2024-04-01 19:27:52 +02:00
|
|
|
bot.send(channel, "Abandon de la revue en cours.")
|
|
|
|
|
2024-01-11 08:17:25 +01:00
|
|
|
return True
|