From c96ad09e100380f2c7416b2f227f471e2e089f79 Mon Sep 17 00:00:00 2001 From: Daniil Demidko Date: Mon, 23 Sep 2024 05:26:13 +0600 Subject: [PATCH] peaceful registration mode disabled --- README.md | 3 --- src/main/kotlin/com/github/demidko/glock/ChatOps.kt | 9 --------- 2 files changed, 12 deletions(-) diff --git a/README.md b/README.md index 00818fd..dc3e64f 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,3 @@ Virtual glock to shoot each other in chat during discussions. Just add [@glockkobot](https://glockkobot.t.me) to your chat and use the `/shoot` command to shoot your buddies. See also `/help`. - -Logging into the game is done by trying to shoot someone else's message, from this point you can be banned (and you can -ban other players). If you are not logged in, then you cannot be shot. diff --git a/src/main/kotlin/com/github/demidko/glock/ChatOps.kt b/src/main/kotlin/com/github/demidko/glock/ChatOps.kt index 659447f..ddefc37 100644 --- a/src/main/kotlin/com/github/demidko/glock/ChatOps.kt +++ b/src/main/kotlin/com/github/demidko/glock/ChatOps.kt @@ -239,10 +239,6 @@ class ChatOps( if (isTopic(target)) { return } - if (!isLegalTarget(target)) { - reply(target, "💨") - return - } val userId = target.from?.id ?: return val untilEpochSecond = now().epochSecond + restrictionsDurationSec bot.restrictChatMember(chatId, userId, restrictions, untilEpochSecond) @@ -257,11 +253,6 @@ class ChatOps( reply(target, shootEmoji) } - private fun isLegalTarget(m: Message): Boolean { - val userId = m.from?.id ?: return false - return userToLastActivity.keys.contains(userId) - } - private fun isLifetimeExceeded(epochSecond: Long): Boolean { return epochSecond < now().epochSecond }