This commit is contained in:
InsanusMokrassar 2022-07-11 00:48:45 +06:00
parent dc8b46dbd6
commit 47a762c8ba
1 changed files with 5 additions and 13 deletions

View File

@ -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"
} }
} }