Added !date command. Extended !help display.
This commit is contained in:
parent
c2471e50c1
commit
03d1555b04
@ -23,8 +23,10 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Collection;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
@ -255,6 +257,7 @@ public class Hebdobot extends PircBot
|
||||
sendMessage(sender, " !stop : abandonner la revue en cours");
|
||||
sendMessage(sender, " !licence : afficher la licence du logiciel Hebdobot et le lien vers ses sources");
|
||||
sendMessage(sender, " !version : afficher la version d'Hebdobot");
|
||||
sendMessage(sender, "Autres commandes de dialogue : !bonjour, !date, !hello, !merci, !salut");
|
||||
}
|
||||
else if (StringUtils.equalsIgnoreCase(text, "!stop"))
|
||||
{
|
||||
@ -529,6 +532,13 @@ public class Hebdobot extends PircBot
|
||||
// Salutation command.
|
||||
sendMessage(sender + ", de rien \\o/");
|
||||
}
|
||||
else if (StringsUtils.equalsAnyIgnoreCase(text, "!date", "!time"))
|
||||
{
|
||||
logger.info("!date caught.");
|
||||
|
||||
// Date command.
|
||||
sendMessage(LocalDateTime.now().format(DateTimeFormatter.ofPattern("EEEE dd MMMM yyyy kk'h'mm", Locale.FRENCH)));
|
||||
}
|
||||
else if (text.startsWith("!"))
|
||||
{
|
||||
logger.info("!??? caught.");
|
||||
|
Loading…
Reference in New Issue
Block a user