GithubHelp home page GithubHelp logo

kseniaglivko / secret_santa_telegram_bot Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 4.18 MB

Telegram Bot to dynamically assign Secret Santas to a specific list of participants

Python 100.00%
bot telegram telegram-bot secret-santa secret-santas christmas

secret_santa_telegram_bot's Introduction

Build Status

Secret Santa Telegram bot

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.

Description

  1. 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.
  2. 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.
  3. 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.
  4. Bot uploads information about Santa and his/hers asignee to the database so the same person wouldn't be assigned twice.

Installation

  1. You need to create a telegram bot and get API Token. See more information here: https://core.telegram.org/bots

  2. git clone https://github.com/kseniaglivko/Secret_Santa_Telegram_bot.git

  3. Open the project in IDE and set up virtual environment.

  4. pip install -r requirements.txt

  5. Insert your API token in bot variable in bot.py line 7.

  6. Before using it you may want to update names in participants_surnames variable in utils.py and in participants variable in bot.py, modify get_declensed_name function in utils.py and so on. You are welcome to modify the code for your own needs.

  7. Go to project directory, open terminal and run python3 main.py

Bot will be active while the terminal is running.

Tests

"tests" directory contains some unittests you may run to check if bot works properly.

secret_santa_telegram_bot's People

Contributors

kseniaglivko avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.