mirror of
https://github.com/InsanusMokrassar/PlaguPoster.git
synced 2025-11-14 18:30:04 +00:00
fix of an error when message in reply didn't contain any post
This commit is contained in:
@@ -69,7 +69,14 @@ object Plugin : Plugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
val postId = messageInReply ?.let {
|
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()
|
} ?: selector ?.take(1) ?.firstOrNull()
|
||||||
if (postId == null) {
|
if (postId == null) {
|
||||||
reply(
|
reply(
|
||||||
|
|||||||
Reference in New Issue
Block a user