readme updated. bug fixed

pull/2/head
Vyacheslav N. Boyko 2018-02-05 00:14:36 +03:00
parent 79091446dc
commit 4195c8bea3
3 changed files with 12 additions and 6 deletions

View File

@ -13,9 +13,13 @@
8. Выдача случайной цитаты из сервиса [Bash.Org / Bash.im](bash.im/random)
9. Авторелогин после кика. Бывают ситуации, когда другой бот автоматически кикает моего бота (в канале #lor на freenode, например).
10. Система отложенных сообщений. Можно написать `?tell <username|me> your phrase here`, и бот доставит это сообщение указанному пользователю, когда он напишет в чат
11. Грамматический контроль и коррекция
_____
### 2018-02-05
* Добавлен модуль грамматического контроля и коррекция
### 2018-02-01
* К боту подключена БД (сейчас PostgreSQL).

View File

@ -5,7 +5,7 @@ After=network.target
[Service]
User=bvn13
WorkingDirectory=/srv/jircbot
ExecStart=/usr/bin/java -jar /srv/jircbot/jircbot-1.1.0.jar
ExecStart=/usr/bin/java -jar /srv/jircbot/jircbot-1.1.1.jar
SuccessExitStatus=143
[Install]

View File

@ -66,7 +66,7 @@ public class GrammarCorrectorListener extends ImprovedListenerAdapter {
if (commands[0].trim().equalsIgnoreCase("add")) {
String params[] = commands[1].trim().split(">");
if (params.length != 2) {
event.respondWith(helpMessage());
event.respond(helpMessage());
} else {
grammarCorrectionService.saveGrammarCorrection(params[0].trim(), params[1].trim(), event.getUser().getNick());
event.respond("added correction: "+params[0].trim()+" > "+params[1].trim());
@ -79,10 +79,12 @@ public class GrammarCorrectorListener extends ImprovedListenerAdapter {
event.respond("correction not found: "+params[0].trim()+" > "+params[1].trim());
}
} else {
event.respondWith(helpMessage());
event.respond(helpMessage());
}
} else if (commands.length == 1) {
if (commands[0].trim().equalsIgnoreCase("show")) {
if (commands[0].trim().equalsIgnoreCase("help")) {
event.respond(helpMessage());
} else if (commands[0].trim().equalsIgnoreCase("show")) {
List<GrammarCorrection> corrections = grammarCorrectionService.getAllCorrections();
if (corrections.size() > 0) {
event.respond("sent in private");
@ -102,7 +104,7 @@ public class GrammarCorrectorListener extends ImprovedListenerAdapter {
}
private String helpMessage() {
return "syntax: \r\n ?correct add <REGEX-formatted word> > <full correction>\r\n ?correct remove <REGEX-formatted word> > <full correction>\r\n ?correct show";
return "syntax: ?correct add <REGEX-formatted word> > <full correction> | ?correct remove <REGEX-formatted word> > <full correction> | ?correct show";
}
}