From 7014ae74f87675e85bd7dbc6923e62eb49b1995b Mon Sep 17 00:00:00 2001 From: parsentev Date: Wed, 21 Aug 2024 13:05:42 +0300 Subject: [PATCH] Fix check if the text of message is not null. --- deploy.bsh | 2 +- src/main/kotlin/pro/dionea/service/actions/ReplyAction.kt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/deploy.bsh b/deploy.bsh index f04e65c..b742551 100644 --- a/deploy.bsh +++ b/deploy.bsh @@ -18,4 +18,4 @@ git rebase mvn clean package -DskipTests=true echo "run project" -nohup java -Xms512m -Xmx1024m "-Dspring.config.location=file:./dionea.properties" -jar target/dionea-0.0.1.jar & \ No newline at end of file +nohup java "-Dspring.config.location=file:./dionea.properties" -jar target/dionea-0.0.1.jar & \ No newline at end of file diff --git a/src/main/kotlin/pro/dionea/service/actions/ReplyAction.kt b/src/main/kotlin/pro/dionea/service/actions/ReplyAction.kt index 220e2b3..6d44d6b 100644 --- a/src/main/kotlin/pro/dionea/service/actions/ReplyAction.kt +++ b/src/main/kotlin/pro/dionea/service/actions/ReplyAction.kt @@ -8,7 +8,9 @@ import org.telegram.telegrambots.meta.api.objects.replykeyboard.buttons.InlineKe class ReplyAction(val botName: String): UpdateAction { override fun check(update: Update): Boolean - = update.message.text.contains(botName) && update.message.isReply + = update.message.text != null + && update.message.text.contains(botName) + && update.message.isReply override fun execute(update: Update, remoteChat: RemoteChat) { val message = update.message