mirror of
https://github.com/InsanusMokrassar/TelegramBotTutorial.git
synced 2024-12-22 06:07:11 +00:00
updates
This commit is contained in:
parent
226ef5df24
commit
c951f074ae
@ -1,9 +1,9 @@
|
||||
[versions]
|
||||
|
||||
kotlin = "1.7.10"
|
||||
plagubot = "2.2.0"
|
||||
kslog = "0.5.1"
|
||||
plagubot-commands = "0.3.2"
|
||||
plagubot = "2.3.3"
|
||||
kslog = "0.5.2"
|
||||
plagubot-commands = "0.3.4"
|
||||
|
||||
[libraries]
|
||||
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
@ -26,6 +26,8 @@ import dev.inmo.tgbotapi.types.commands.BotCommandScope
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||
import dev.inmo.tgbotapi.utils.regular
|
||||
import dev.inmo.tgbotapi.utils.underline
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.flow.filter
|
||||
import kotlinx.coroutines.flow.first
|
||||
@ -79,17 +81,16 @@ class WelcomePlugin : Plugin {
|
||||
val user = groupMessage.user
|
||||
|
||||
if (userIsAdmin(user, groupMessage.chat)) {
|
||||
val sentMessage = sendMessage(
|
||||
val sentMessage = send(
|
||||
user,
|
||||
buildEntities {
|
||||
regular("Ok, send me the message which should be used as welcome message for chat ")
|
||||
underline(groupMessage.chat.title)
|
||||
},
|
||||
replyMarkup = flatInlineKeyboard {
|
||||
dataButton("Unset", unsetData)
|
||||
dataButton("Cancel", cancelData)
|
||||
}
|
||||
)
|
||||
) {
|
||||
regular("Ok, send me the message which should be used as welcome message for chat ")
|
||||
underline(groupMessage.chat.title)
|
||||
}
|
||||
|
||||
oneOf(
|
||||
parallel {
|
||||
@ -97,7 +98,7 @@ class WelcomePlugin : Plugin {
|
||||
it.data == unsetData && it.message.sameMessage(sentMessage)
|
||||
}.first()
|
||||
|
||||
val answerEntities = buildEntities {
|
||||
edit(sentMessage) {
|
||||
if (welcomeTable.unset(groupMessage.chat.id)) {
|
||||
regular("Welcome message has been removed for chat ")
|
||||
underline(groupMessage.chat.title)
|
||||
@ -107,11 +108,6 @@ class WelcomePlugin : Plugin {
|
||||
}
|
||||
}
|
||||
|
||||
edit(
|
||||
sentMessage,
|
||||
answerEntities
|
||||
)
|
||||
|
||||
answer(query)
|
||||
},
|
||||
parallel {
|
||||
@ -120,12 +116,11 @@ class WelcomePlugin : Plugin {
|
||||
}.first()
|
||||
|
||||
edit(
|
||||
sentMessage,
|
||||
buildEntities {
|
||||
regular("You have cancelled change of welcome message for chat ")
|
||||
underline(groupMessage.chat.title)
|
||||
}
|
||||
)
|
||||
sentMessage
|
||||
) {
|
||||
regular("You have cancelled change of welcome message for chat ")
|
||||
underline(groupMessage.chat.title)
|
||||
}
|
||||
|
||||
answer(query)
|
||||
},
|
||||
@ -142,7 +137,7 @@ class WelcomePlugin : Plugin {
|
||||
)
|
||||
)
|
||||
|
||||
val entities = buildEntities {
|
||||
reply(message) {
|
||||
if (success) {
|
||||
regular("Welcome message has been changed for chat ")
|
||||
underline(groupMessage.chat.title)
|
||||
@ -153,10 +148,6 @@ class WelcomePlugin : Plugin {
|
||||
underline(groupMessage.chat.title)
|
||||
}
|
||||
}
|
||||
reply(
|
||||
message,
|
||||
entities
|
||||
)
|
||||
},
|
||||
parallel {
|
||||
while (isActive) {
|
||||
|
Loading…
Reference in New Issue
Block a user