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 is deliberately unhurried: google answers a burst of writes to one calendar with "Rate Limit Exceeded", so the pass waits between entries and leaves the rest for the next start if the calendar refuses five times in a row.

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.1.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.1-py3-none-any.whl (5.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: leistungsbot-1.4.1.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.1.tar.gz
Algorithm Hash digest
SHA256 a94d026306225ddcfd7b4c387bda697b247c54feb3ac114962f088f87c877b10
MD5 a960194b8b2cf2e9ee7ce9172b0007f2
BLAKE2b-256 df5948fb97b5fe59fe0bd1707f4be6aa9ac549e8bf5a081995f23954075b657b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: leistungsbot-1.4.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 631d36fd5f60064c29699ad390afaae9f429f860bfed5bb72dc74bb05b7a744f
MD5 da01b61513981237335dd667031dae84
BLAKE2b-256 afdb450decc42395ca7a0f8112a45adca0da304cab45fe6a8350a1e19cfae043

See more details on using hashes here.

Release history Release notifications | RSS feed

1.4.2

2 files

This release

1.4.1 This release

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