Skip to main content

Tests Status Docker Image CI pre-commit.ci status Code style: black

Development database

The bot needs a database with something in it before most commands do anything interesting. tools/seed_dev_db.py builds one full of invented data - pubs that do not exist, telegram ids far below the range telegram issues, and leistungstage spread around today so /history, /sendreminder and the scheduler's reminder window all have something to find:

python tools/seed_dev_db.py
LEISTUNGSBOT_SQLITE__PATH=$PWD/leistungs_db.dev.sqlite python -m leistungsbot

The same seed always produces the same database, so --seed 7 gives a different but equally repeatable set.

To look inside it, docker compose --profile dev up starts a SQLite browser on https://localhost:3001.

Calendar

The bot can keep a calendar in step with the leistungstage: publishing one creates an entry, closing the poll or moving it to another location updates that entry, and purging it takes the entry away again. It hangs off the database rather than off the commands, so the scheduler closing a poll on its own counts too.

At every start the bot also walks the whole leistungstag table into the calendar, oldest first and in a background thread. That is what gets the leistungstage that predate the calendar in there, and it is safe to repeat - an entry is identified by the leistungstag it belongs to, so it is written over rather than duplicated. It reads the calendar once and then writes only what is missing or says something else, so the usual start costs a single request. The writes that are left are paced - google answers a burst of them with "Rate Limit Exceeded" - and five refusals in a row leave the rest for the next start.

Off unless configured, which is the calendar section:

calendar:
  provider: "google"
  calendar_id: "abc123@group.calendar.google.com"
  credentials: "/data/google-service-account.json"
  timezone: "Europe/Vienna"

timezone may be left out, in which case the container's TZ decides and Europe/Vienna is the last word. Times go into the calendar as wall clock plus that zone, so a leistungstag stays at seven in the evening across a daylight saving change.

credentials is the json key of a google service account - a bot has nobody to click through a consent screen. The service account cannot make a calendar for itself, so make one and share it with the account's email address as "make changes to events".

Google is the only provider so far. leistungsbot/leistungs_calendar.py is the part that does not know that: a second one is a Calendar subclass and a line in from_config.

Intro

This Is A Simple Bot To Create Poll In Channel and Groups
And Also This Is our First Project Too..

Enter you tokens at these are very important VARS:

Without fork you cant deploy so fork it and edit in Bot.py#L22

DEVLOPERS

😎ROHITH ROHITHADITYA
😋PARVAT PARVAT_R

QUICK NOTES

DONT FORGET TO JOIN Venila Bots

LANUGUAGES


>> PY BOT API
>> PYTHON

SUPPORT GROUP



SIMLIFIED READ ME HERE

Read Me --> SIMPLIFIED README

DEPLOY

DEPLOY TO HEROKU

Deploy

RUN IN TERMUX

git clone https://github.com/Botsuniverse/poll-bot
cd poll-bot
python3 Bot.py

RUN IN PYDROID 3

(x) Just Copy The Bot.py to pydroid and Simply Run it

RUN IN YOUR LINUX VPS OR DESKTOP

sudo apt update
sudo apt upgrade
git clone https://github.com/Botsuniverse/poll-bot
python3 Bot.py

RUN THIS IN WINDOWS TERMINAL

git clone https://github.com/BotsUniverse/poll-bot/
cd where_the_fuck_you_stored/poll-bot
py Bot.py

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leistungsbot-1.4.2.tar.gz (4.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

leistungsbot-1.4.2-py3-none-any.whl (5.0 MB view details)

Uploaded Python 3

File details

Details for the file leistungsbot-1.4.2.tar.gz.

File metadata

  • Download URL: leistungsbot-1.4.2.tar.gz
  • Upload date:
  • Size: 4.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.0 Linux/6.17.0-1020-azure

File hashes

Hashes for leistungsbot-1.4.2.tar.gz
Algorithm Hash digest
SHA256 350f6127108666e4bf772369730b80cc298928962783ab98ce592493cd5ff006
MD5 c39bc001cf3753032ef67b6af2f4a353
BLAKE2b-256 87a0545cdc4ef832a9746135a2f296e8cfa877406b9f906f3afb5c764f7e2ec7

See more details on using hashes here.

File details

Details for the file leistungsbot-1.4.2-py3-none-any.whl.

File metadata

  • Download URL: leistungsbot-1.4.2-py3-none-any.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.0 Linux/6.17.0-1020-azure

File hashes

Hashes for leistungsbot-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 383f814a5cd5241252203fa899ee57dbda525be3412feb2395550587bd787373
MD5 6a5e66aeacf327affd66e9893c9aaa27
BLAKE2b-256 3548e99b7ac9ae883ac93236e7cfa3670ad6fbc38296500eb4e028dd91dfbc19

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.4.2 This release

2 files

1.4.1

2 files

1.4.0

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page