mirror of
https://github.com/InsanusMokrassar/TelegramBotTutorial.git
synced 2024-12-22 06:07:11 +00:00
refactor after dependencies update
This commit is contained in:
parent
cf0b214ee8
commit
33b2b4fbcb
@ -15,6 +15,8 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMe
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitMessageDataCallbackQuery
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitMessageDataCallbackQuery
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.*
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.*
|
||||||
import dev.inmo.tgbotapi.extensions.utils.*
|
import dev.inmo.tgbotapi.extensions.utils.*
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.extensions.sameChat
|
||||||
|
import dev.inmo.tgbotapi.extensions.utils.extensions.sameMessage
|
||||||
import dev.inmo.tgbotapi.extensions.utils.formatting.*
|
import dev.inmo.tgbotapi.extensions.utils.formatting.*
|
||||||
import dev.inmo.tgbotapi.extensions.utils.types.buttons.*
|
import dev.inmo.tgbotapi.extensions.utils.types.buttons.*
|
||||||
import dev.inmo.tgbotapi.types.BotCommand
|
import dev.inmo.tgbotapi.types.BotCommand
|
||||||
@ -83,20 +85,16 @@ class WelcomePlugin : Plugin {
|
|||||||
regular("Ok, send me the message which should be used as welcome message for chat ")
|
regular("Ok, send me the message which should be used as welcome message for chat ")
|
||||||
underline(groupMessage.chat.title)
|
underline(groupMessage.chat.title)
|
||||||
},
|
},
|
||||||
replyMarkup = inlineKeyboard {
|
replyMarkup = flatInlineKeyboard {
|
||||||
row {
|
dataButton("Unset", unsetData)
|
||||||
dataButton("Unset", unsetData)
|
dataButton("Cancel", cancelData)
|
||||||
dataButton("Cancel", cancelData)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
oneOf(
|
oneOf(
|
||||||
parallel {
|
parallel {
|
||||||
val query = waitMessageDataCallbackQuery().filter {
|
val query = waitMessageDataCallbackQuery().filter {
|
||||||
it.data == unsetData
|
it.data == unsetData && it.message.sameMessage(sentMessage)
|
||||||
&& it.message.chat.id == sentMessage.chat.id
|
|
||||||
&& it.message.messageId == sentMessage.messageId
|
|
||||||
}.first()
|
}.first()
|
||||||
|
|
||||||
val answerEntities = buildEntities {
|
val answerEntities = buildEntities {
|
||||||
@ -118,9 +116,7 @@ class WelcomePlugin : Plugin {
|
|||||||
},
|
},
|
||||||
parallel {
|
parallel {
|
||||||
val query = waitMessageDataCallbackQuery().filter {
|
val query = waitMessageDataCallbackQuery().filter {
|
||||||
it.data == cancelData
|
it.data == cancelData && it.message.sameMessage(sentMessage)
|
||||||
&& it.message.chat.id == sentMessage.chat.id
|
|
||||||
&& it.message.messageId == sentMessage.messageId
|
|
||||||
}.first()
|
}.first()
|
||||||
|
|
||||||
edit(
|
edit(
|
||||||
@ -135,7 +131,7 @@ class WelcomePlugin : Plugin {
|
|||||||
},
|
},
|
||||||
parallel {
|
parallel {
|
||||||
val message = waitContentMessage().filter {
|
val message = waitContentMessage().filter {
|
||||||
it.chat.id == sentMessage.chat.id
|
it.sameChat(sentMessage)
|
||||||
}.first()
|
}.first()
|
||||||
|
|
||||||
val success = welcomeTable.set(
|
val success = welcomeTable.set(
|
||||||
|
Loading…
Reference in New Issue
Block a user