29 lines
847 B
Python
29 lines
847 B
Python
|
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.send(channel, "Abandon de la revue en cours.")
|
||
|
bot.review.cancel()
|
||
|
return True
|