mirror of
https://github.com/InsanusMokrassar/TelegramBotTutorial.git
synced 2024-12-22 06:07:11 +00:00
fixes
This commit is contained in:
parent
dc8b46dbd6
commit
47a762c8ba
@ -78,9 +78,6 @@ class WelcomePlugin : Plugin {
|
|||||||
val user = groupMessage.user
|
val user = groupMessage.user
|
||||||
|
|
||||||
if (userIsAdmin(user, groupMessage.chat)) {
|
if (userIsAdmin(user, groupMessage.chat)) {
|
||||||
val cancelData = "cancel_${groupMessage.chat.id}"
|
|
||||||
val unsetData = "unset_${groupMessage.chat.id}"
|
|
||||||
|
|
||||||
val sentMessage = sendMessage(
|
val sentMessage = sendMessage(
|
||||||
user,
|
user,
|
||||||
buildEntities {
|
buildEntities {
|
||||||
@ -197,9 +194,7 @@ class WelcomePlugin : Plugin {
|
|||||||
|
|
||||||
onCommand(
|
onCommand(
|
||||||
"welcome",
|
"welcome",
|
||||||
initialFilter = {
|
initialFilter = { it.chat is GroupChat }
|
||||||
it.chat is GroupChat
|
|
||||||
}
|
|
||||||
) {
|
) {
|
||||||
it.whenCommonGroupContentMessage { groupMessage ->
|
it.whenCommonGroupContentMessage { groupMessage ->
|
||||||
launch {
|
launch {
|
||||||
@ -216,8 +211,8 @@ class WelcomePlugin : Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
copyMessage(
|
reply(
|
||||||
it.chat.id,
|
it,
|
||||||
chatSettings.sourceChatId,
|
chatSettings.sourceChatId,
|
||||||
chatSettings.sourceMessageId
|
chatSettings.sourceMessageId
|
||||||
)
|
)
|
||||||
@ -225,14 +220,11 @@ class WelcomePlugin : Plugin {
|
|||||||
welcomeTable.unset(it.chat.id)
|
welcomeTable.unset(it.chat.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
allUpdatesFlow.subscribeSafelyWithoutExceptions(scope) {
|
|
||||||
println(it)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val pluginConfigSectionName = "welcome"
|
private const val pluginConfigSectionName = "welcome"
|
||||||
|
private const val cancelData = "cancel"
|
||||||
|
private const val unsetData = "unset"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user