This is a telegram bot to dynamically assign Secret Santas to a specific list of participants
Note: the bot was created to be used with russian names.
Bot is case insensitive and understands diminutive names.
- User types in his/her name, then the name is checked to be in the participants list. If it is not in the list - bot throws an error.
- Then the name is checked to be in the database - to check whether the user already has an asignee. If the person enters his/her name twice - bot throws an error.
- After checking, bot assigns a name from the participants list to the user, displays the name and a sticker to the user. While assigning, bot excludes the user's name from selection.
- Bot uploads information about Santa and his/hers asignee to the database so the same person wouldn't be assigned twice.
-
You need to create a telegram bot and get API Token. See more information here: https://core.telegram.org/bots
-
git clone https://github.com/kseniaglivko/Secret_Santa_Telegram_bot.git
-
Open the project in IDE and set up virtual environment.
-
pip install -r requirements.txt
-
Insert your API token in
bot
variable in bot.py line 7. -
Before using it you may want to update names in
participants_surnames
variable in utils.py and inparticipants
variable in bot.py, modifyget_declensed_name
function in utils.py and so on. You are welcome to modify the code for your own needs. -
Go to project directory, open terminal and run
python3 main.py
Bot will be active while the terminal is running.
"tests" directory contains some unittests you may run to check if bot works properly.