Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Better implementation #1

Open
zeroone2numeral2 opened this issue Dec 2, 2019 · 2 comments
Open

Better implementation #1

zeroone2numeral2 opened this issue Dec 2, 2019 · 2 comments

Comments

@zeroone2numeral2
Copy link
Owner

zeroone2numeral2 commented Dec 2, 2019

A better way of handling the registration and matching flow, based on the reddit thread suggestions

The bot should show the current message plus an url inline button labeled "start me to join!", that will bring the user to the private chat with the bot. The deeplink payload should contain the chat id and the message id, and add the user to the chat's chat_data, that will contain the list of users who joined the Secret Santa (plus some other metadata). This should also update the message in the chat with a mention of the user (and also maybe the bot should send new message saying that xyz joined the party).

The message sent in response to the "/start" deeplink message should contain a button to unsubscribe to the Secret Santa, too (and also, when someone unsubscribes, we should send a notification in the chat).

Once two members have joined, the message containing the list should also include an inline button to start the matching (who can use this button? Everyone? Only the admins? Only the user who added the bot?). Also, maybe, there should be an inline button to unsubscribe from the party.


chat_data structure idea:

a chat can have more than one Secret Santa. Its identifier should be the message_id. We should store the creation date and a "last activity" date too, so we can use a job to wipe out old Secret Santa's keys.

{
  message_id = {
    'message_id': message_id,
    'participants': {user_id: {'name': str(), 'match_message_id': int(), ...},
    'creation_date': datetime.datetime.now(),
    'last_activity': datetime.datetime.now(),
    'creator_id': user_id,
    'chat_title': chat.title,
  }
}
@zeroone2numeral2
Copy link
Owner Author

> implying I have the time to do this

@zeroone2numeral2
Copy link
Owner Author

zeroone2numeral2 commented Nov 16, 2021

Concept:

Secret Santa message

  • the message should have the following buttons:
    • join
    • unsubscribe
    • cancel (creator only)
    • start! (creator only)
  • the message should contain the following info:
    • created by
    • number of participants
    • "tap join to join, unsubscribe to unsubscribe"

On "join" button click

When the button is used, the user is sent to the private chat with the bot via deeplink. The deeplink should contain chat_id and message_id of the Secret Santa draw

Make sure the Secret Santa still exists

The bot answer should link the message in the group if the group is a supergroup

The message should show an inline button to unsubscribe

When the Secret Santa is created

Make sure there are at least 4 participants

We try to send a typing action to everyone. If even one fails, answer to the Secret Santa message saying that {name} has blocked the bot or we can't message them

If all typing actions succeed:

  • send the match message
  • store the sent message id, in case we (...we what?)
  • answer to the Secret Santa message in the group and say that everyone should have received their match
  • remove buttons from the Secret Santa message
  • cleanup data

Misc

  • when someone joins, send a message in the group?
  • join that clean up Secret Santas that have been inactive for n days

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

No branches or pull requests

1 participant