Skip to content

Commit

Permalink
peaceful registration mode disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
demidko committed Sep 22, 2024
1 parent c3b4522 commit c96ad09
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
9 changes: 0 additions & 9 deletions src/main/kotlin/com/github/demidko/glock/ChatOps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}
Expand Down

0 comments on commit c96ad09

Please sign in to comment.