Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Sorting 'get active users' issue #14

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

WIP: Sorting 'get active users' issue #14

wants to merge 4 commits into from

Conversation

vindard
Copy link
Collaborator

@vindard vindard commented Aug 15, 2018

Issue #13

There's currently a getActive() function and a few bot commands (/active, /rain) that make use of it. This function doesn't work as the code is right now though, so this PR is to explore whether this can be fixed or whether any decent alternatives can be added.

@vindard vindard changed the title Sorting 'get active users' issue WIP: Sorting 'get active users' issue Aug 15, 2018
@vindard
Copy link
Collaborator Author

vindard commented Aug 15, 2018

@johnsBeharry @micey969 I added a new function getRegistered() and a new bot command /getbotusers to make use of it. This function pulls all the users registered with the BlockIO API across all chat sessions and returns it in the chat.

Ideally, there should be a way to filter this list down to just the users within the chat the bot command is called, but as of right now I haven't found any easy ways to get a list of those users using the Telegram API. The closest thing I've found is to manually document the current users in particular chats and then to keep track of added/removed users using this method.

@johnsBeharry
Copy link
Member

@vindard what's the expected behavior when using /rain and /active though? and how do we define active user?

Could you help fill these gaps?

Scenario: Get list of active users
Given there are 10 users in a telegram group
When a user types `/active` command in the group
Then ___

Scenario: Send dogecoin to all active users
Given there are 10 users in a telegram group
When a user uses `/rain` command in the group
Then ___

@vindard
Copy link
Collaborator Author

vindard commented Aug 17, 2018

@johnsBeharry sure man

Scenario: Get list of active users
Given there are 10 users in a telegram group
When a user types `/active` command in the group
Then the number of active users is returned, with active defined as users who have shown activity within the last 600 seconds

Note: it's unclear from the code where this user list is meant to be drawn from and how the 'time since last active' data point would be obtained to determine who is active. Telegram's API doesn't support either of these features directly.


Scenario: Send dogecoin to all active users
Given there are 10 users in a telegram group
When a user uses `/rain` command in the group
Then 10 doge is sent to all active users from the user calling the command

Note: This command only sends doge to "active persons" as defined in the /active command scenario above.

@vindard vindard force-pushed the getActive branch 2 times, most recently from 2bf280f to fe833c8 Compare August 27, 2018 10:43
@johnsBeharry
Copy link
Member

@vindard the stalest branch ever? sorry I never got to merging this. ill have a look at it over the weekend.

@vindard
Copy link
Collaborator Author

vindard commented May 7, 2021

^

Then 10 doge is sent to all active users from the user calling the command

@johnsBeharry we might need to revisit that /rain amount 🤑

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants