mirror of
https://github.com/InsanusMokrassar/PlaguPoster.git
synced 2024-11-25 08:58:45 +00:00
fix of an error when message in reply didn't contain any post
This commit is contained in:
parent
3242810ef6
commit
8730c67084
@ -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(
|
||||||
|
Loading…
Reference in New Issue
Block a user