fix of an error when message in reply didn't contain any post

This commit is contained in:
InsanusMokrassar 2022-11-18 15:24:21 +06:00
parent 3242810ef6
commit 8730c67084
1 changed files with 8 additions and 1 deletions

View File

@ -69,7 +69,14 @@ object Plugin : Plugin {
}
}
val postId = messageInReply ?.let {
postsRepo.getIdByChatAndMessage(messageInReply.chat.id, messageInReply.messageId)
postsRepo.getIdByChatAndMessage(messageInReply.chat.id, messageInReply.messageId) ?: let { _ ->
reply(
it,
"Unable to find any post related to the message in reply"
)
return@onCommand
}
} ?: selector ?.take(1) ?.firstOrNull()
if (postId == null) {
reply(