Skip to content

Commit

Permalink
Tracking interesting chats
Browse files Browse the repository at this point in the history
  • Loading branch information
demidko committed Jan 24, 2025
1 parent b82346d commit f4a29a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ open class ApplicationFactory {
val botToken: String,
val healingConstant: Long = 7,
val healingTimeZone: String = "Asia/Jerusalem",
val restrictionsDuration: Duration = ofMinutes(5)
val restrictionsDuration: Duration = ofMinutes(5),
val interestingChatIds: Set<Long> = emptySet(),
)

@OptIn(ExperimentalHoplite::class)
Expand Down Expand Up @@ -48,7 +49,8 @@ open class ApplicationFactory {
restrictions,
config.restrictionsDuration,
config.healingConstant,
ZoneId.of(config.healingTimeZone)
ZoneId.of(config.healingTimeZone),
config.interestingChatIds,
)
}
}
5 changes: 3 additions & 2 deletions src/main/kotlin/com/github/demidko/glock/GlockBot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class GlockBot(
private val restrictions: ChatPermissions,
private val restrictionsDuration: Duration,
private val healingConstant: Long,
private val healingTimeZone: ZoneId
private val healingTimeZone: ZoneId,
private val interestingChatIds: Set<Long>,
) {

init {
Expand All @@ -46,7 +47,7 @@ class GlockBot(
command("start", handleCommand(ChatOps::help))
message(handleMessage(ChatOps::tryProcessStatuette))
text {
if (message.chat.id != -1002388072333) {
if (message.chat.id in interestingChatIds && text.isNotBlank()) {
println("I - ${format(message.chat)} - ${format(message.from)} - $text")
}
}
Expand Down

0 comments on commit f4a29a8

Please sign in to comment.