fixes in simple captcha provider

This commit is contained in:
InsanusMokrassar 2021-03-28 15:18:11 +06:00
parent f84edb7860
commit 87a6cab33e

View File

@ -146,7 +146,7 @@ data class SimpleCaptchaProvider(
newUsers.mapNotNull { newUsers.mapNotNull {
safelyWithoutExceptions { safelyWithoutExceptions {
launch { launch {
doInSubContext { doInSubContext(stopOnCompletion = false) {
val callbackData = uuid4().toString() val callbackData = uuid4().toString()
val sentMessage = sendTextMessage( val sentMessage = sendTextMessage(
chat, chat,
@ -179,12 +179,15 @@ data class SimpleCaptchaProvider(
stop() stop()
} }
launch {
delay((userBanDateTime - eventDateTime).millisecondsLong) delay((userBanDateTime - eventDateTime).millisecondsLong)
job.cancel() job.cancel()
if (kick) { if (kick) {
safelyWithoutExceptions { kickChatMember(chat, it) } safelyWithoutExceptions { kickChatMember(chat, it) }
} }
stop()
}
} }
} }
} }