Git Product home page Git Product logo

telegram-sport-event-bot's Introduction

Telegram Bot for organizing sport or any other events for small groups

About

The bot will maintain a list of participants for you, giving you the opportunity to sign up for an event simply by clicking on one button. And also cancel your application for participation. (In this case, the canceled order will also be displayed at the bottom in a separate block, and the date and time of the cancellation of the order will be shown next to it).

Event example

If you set a limit on the number of participants (using the /limit X command), then the bot will place in the second "Reserve" list all those who did not manage to get into the main list.

An event is created with just one command: /event_add TEXT If you set the date and time in the text (it can be in any form, the bot can handle it), then the event description will always display the date and time, as well as how much time is left before the start.

You can set the date and time later with a separate command: /event_datetime datetime To maintain statistics on participants, completed events can be fixed with the /fix command.

Then the /stat command will display data on group members. Specifically, the number of registrations for events and the number of penalty points. Penalty points can be assigned to users with the /penalty USERID command, for example, for missing events without canceling the application in a timely manner. Used only to mark the most irresponsible users. If the application/penalty ratio is poor, a yellow card (one, two or three) will be displayed next to the username.

In addition to English, Ukrainian, Russian and Portuguese languages are also supported.

You can just use this bot on my server (it's available for now by telegram name @zp_futsal_bot). Just invite bot to your group. Or install your bot version on your server.

Installation

First of all you need Python 3.7+. Then follow these steps:

  1. Clone the repo

    git clone https://github.com/KMiNT21/telegram_sport_event_bot.git
    
  2. Get a free TELEGRAM BOT TOKEN (Start dialog with BotFather and follow instructions). Save token in token.txt file inside project's folder.

  3. Install requirements by command

    pip install -r requirements.txt
  4. Run 'python db.py' once to create new database.

    python db.py
  5. Run 'python sport_event_bot.py'.

    python sport_event_bot.py

telegram-sport-event-bot's People

Contributors

kmint21 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

telegram-sport-event-bot's Issues

Possible bug in adding penalty

I've used python-telegram-bot==13.5

https://github.com/KMiNT21/telegram-sport-event-bot/blob/master/sport_event_bot.py#L373
In this line I had error

`

File "/home/bot/telegram-sport-event-bot/sport_event_bot.py", line 373, in penalty_player
db.penalty_for_user_in_chat(chat_id=update.message.chat_id, user_id=user_id, operator_id=update.message.from_user.user_id)
│ │ │ │ │ │ │ │ └ <telegram.user.User objec
t at 0xffff9bef6fa0>
│ │ │ │ │ │ │ └ <telegram.message.Message object
at 0xffff9bef6e80>
│ │ │ │ │ │ └ <telegram.update.Update object at 0xff
ff9bef6b80>
│ │ │ │ │ └ '542117150'
│ │ │ │ └ <property object at 0xffff9c97f680>
│ │ │ └ <telegram.message.Message object at 0xffff9bef6e80>
│ │ └ <telegram.update.Update object at 0xffff9bef6b80>
│ └ <function penalty_for_user_in_chat at 0xffff9c0a1280>
└ <module 'db' from '/home/bot/telegram-sport-event-bot/db.py'>

AttributeError: 'User' object has no attribute 'user_id'
`

probably it would be better to change update.message.from_user.user_id to update.message.from_user.id

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.