Restricted the use of !debut command when review is already started

(#3689).
This commit is contained in:
Christian P. MOMON 2019-05-03 16:18:27 +02:00
parent 29e878a02a
commit a9057039c4
1 changed files with 23 additions and 16 deletions

View File

@ -54,24 +54,31 @@ public class StartReviewHook extends Hook
else
{
// Start.
if (bot.getCronManager() != null)
if (bot.getReview() != null)
{
try
{
bot.getCronManager().shutdown();
}
catch (SchedulerException exception)
{
logger.warn("Scheduler shutdown failed.", exception);
}
bot.sendMessage("% " + sender + ", une revue est déjà en cours.");
}
else
{
if (bot.getCronManager() != null)
{
try
{
bot.getCronManager().shutdown();
}
catch (SchedulerException exception)
{
logger.warn("Scheduler shutdown failed.", exception);
}
}
bot.setReview(new Review(sender, bot.getAliases()));
bot.sendMessage(sender, "Bonjour " + sender + ", vous êtes le conducteur de réunion.");
bot.sendMessage(sender, "Pour terminer la réunion, tapez \"!fin\"");
bot.sendMessage("% Début de la réunion hebdomadaire");
bot.sendMessage(
"% rappel : toute ligne commençant par % sera considérée comme un commentaire et non prise en compte dans la synthèse");
bot.sendMessage("% pour connaître le point courant, taper !courant");
}
bot.setReview(new Review(sender, bot.getAliases()));
bot.sendMessage(sender, "Bonjour " + sender + ", vous êtes le conducteur de réunion.");
bot.sendMessage(sender, "Pour terminer la réunion, tapez \"!fin\"");
bot.sendMessage("% Début de la réunion hebdomadaire");
bot.sendMessage(
"% rappel : toute ligne commençant par % sera considérée comme un commentaire et non prise en compte dans la synthèse");
bot.sendMessage("% pour connaître le point courant, taper !courant");
}
result = true;