timecobot icon indicating copy to clipboard operation
timecobot copied to clipboard

Bots' power

Open y9san9 opened this issue 3 years ago • 10 comments

Hi! Discovered this project right now from Habr article and it's awesome. Nice idea, but I have a question, haven't tried yet, but what if I create a lot of accounts (which I already have), enter in a chat with the bot, then write some messages from account and just wait for a while. Will I have a power equals time * accounts_count? Or there is some protection from it (suppose all bots have written human-like first messages)

y9san9 avatar May 10 '21 13:05 y9san9

Hi! Discovered this project right now from Habr article and it's awesome. Nice idea, but I have a question, haven't tried yet, but what if I create a lot of accounts (which I already have), enter in a chat with the bot, then write some messages from account and just wait for a while. Will I have a power equals time * accounts_count? Or there is some protection from it (suppose all bots have written human-like first messages)

"Real" bots (telegram bots api) are not counted by default. However, there is no protection against user-bots (Telegram client api). At the moment, there is no technical way to distinguish them from real users.

demidko avatar May 10 '21 13:05 demidko

Of course I am talking about user-bots, I know telegram api very well :) And I know that there is no way to detect if user is bot, but you can count not time but messages count.

I mean, it may be some formula like

val rating = messages_count * (userTimeInChat / chatDuration)

Where chatDuration is how many time is bot in chat, so for example if a user is in the chat for 10 days, while chat exists (actually bot in chat exists) 30 days, user rating will be counted as 33%, 1/3 of his messages (when user joined it was only 5%, 1/20). Of course this leads to cases when chat is very old and new users actually don't have permissions for a long time, while old users already aren't active, so you can also calculate daily average rating and give minutes relatively this.

Read the message below

This is just suggestion how the system may look like, my point is that it is important to count not only time but messages count too, to prevent from user bots that cannot send more than one-two human-like messages

y9san9 avatar May 10 '21 13:05 y9san9

Another suggestion is to count time * (userMessages / totalMessagesSinceFirst), so user will have not all time he is in a chat, but only percent he was writing messages of this time. Example: A user is in a chat 10 minutes, he has written 5 messages, while total there was 20 messages, so he has only 10 * 20% = 2 minutes

y9san9 avatar May 10 '21 13:05 y9san9

May be there is a reason to count only last 30 days activity or etc., anyway you should come up with system like this :)

y9san9 avatar May 10 '21 13:05 y9san9

Of course I am talking about user-bots, I know telegram api very well :) And I know that there is no way to detect if user is bot, but you can count not time but messages count.

I mean, it may be some formula like

val rating = messages_count * (userTimeInChat / chatDuration)

Where chatDuration is how many time is bot in chat, so for example if a user is in the chat for 10 days, while chat exists (actually bot in chat exists) 30 days, user rating will be counted as 33%, 1/3 of his messages (when user joined it was only 5%, 1/20). Of course this leads to cases when chat is very old and new users actually don't have permissions for a long time, while old users already aren't active, so you can also calculate daily average rating and give minutes relatively this.

Read the message below

This is just suggestion how the system may look like, my point is that it is important to count not only time but messages count too, to prevent from user bots that cannot send more than one-two human-like messages

In the current implementation, the time is carried over between chats. In other words, time is an attribute of the Telegram user, not the chat user. Your idea is good, but it will take a lot of resources. In essence, you are proposing to repeat Telegram's work to identify user-bots in each chat.

demidko avatar May 10 '21 13:05 demidko

Your idea is worse then, because I can create my private chat and get a lot of minutes and then ban people in random chats

y9san9 avatar May 10 '21 14:05 y9san9

Your idea is worse then, because I can create my private chat and get a lot of minutes and then ban people in random chats

In my opinion, intergroup time makes the "game" more interesting. Exchange, inter-group trade, shootouts are possible.

demidko avatar May 10 '21 14:05 demidko

Ok, I've started farming the time, just wait...

But also wanna suggest the most convenient one for chat idea. I suggest share time between users, so there may be segments of time with length equals one day. After day goes by, its time shares between most active users, example: User A've written 100 messages User B've written 50 messages User C've written 30 messages User bot D've written 2 messages (it's like real human messages, so it wasn't kicked) So they will share between them 55%, 28%, 16%, 1% of day's time correspondingly (only for this chat, cuz I could create private chat and spam in it with user bots)

This system is protected from user bots.

y9san9 avatar May 10 '21 14:05 y9san9

Ok, I've started farming the time, just wait...

But also wanna suggest the most convenient one for chat idea. I suggest share time between users, so there may be sements of time with length equals one day. After day goes by, its time shares between most active users, example: User A've written 100 messages User B've written 50 messages User C've written 30 messages User bot D've written 2 messages (it's like real human messages, so it wasn't kicked) So they will share between them 55%, 28%, 16%, 1% of day's time correspondingly (only for this chat, cuz I could create private chat and spam in it with user bots)

This system is protected from user bots.

It is important for me that the principle of the system's operation remains simple and understandable for all users. I would prefer to add a robbery mechanic for the duration of the ban. Thanks for the idea (last option). I plan to experiment in a separate branch.

demidko avatar May 10 '21 14:05 demidko

Ok, I've started farming the time, just wait...

But also wanna suggest the most convenient one for chat idea. I suggest share time between users, so there may be segments of time with length equals one day. After day goes by, its time shares between most active users, example: User A've written 100 messages User B've written 50 messages User C've written 30 messages User bot D've written 2 messages (it's like real human messages, so it wasn't kicked) So they will share between them 55%, 28%, 16%, 1% of day's time correspondingly (only for this chat, cuz I could create private chat and spam in it with user bots)

This system is protected from user bots.

I have an integration test for finding miners)

@Test
fun checkoutTheRich() = takeControl { bot, db ->

  val filter = days(now().toEpochDay() - SystemStartDay)

  val rich =
    db.mapValues { seconds(it.value) }
      .filterValues { it >= filter }
      .mapKeys { bot.getChat(it.key).first?.body()?.result }

  rich.forEach { (user, capital) ->
    println("$user —  ${capital.inWholeDays} days")
  }
}

demidko avatar May 10 '21 16:05 demidko