mirror of
https://github.com/InsanusMokrassar/PlaguPoster.git
synced 2026-11-09 12:23:12 +00:00
fix of an error when message in reply didn't contain any post
This commit is contained in:
1 parent
3242810ef6
commit
8730c67084
1 file changed
+8
-1
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user