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 GroupsAnd 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
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
Metadata
Release files for leistungsbot 1.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| leistungsbot-1.4.2.tar.gz | 4.9 MB | Without provenance | Details for leistungsbot-1.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| leistungsbot-1.4.2-py3-none-any.whl | Python 3 | none | any | Details for leistungsbot-1.4.2-py3-none-any.whl |
Total release size: 9.9 MB
Release files / leistungsbot-1.4.2.tar.gz
| Download URL | leistungsbot-1.4.2.tar.gz |
|---|---|
| Size | 4.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
350f6127108666e4bf772369730b80cc298928962783ab98ce592493cd5ff006
|
|
BLAKE2b-256 checksum How to use checksums |
87a0545cdc4ef832a9746135a2f296e8cfa877406b9f906f3afb5c764f7e2ec7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.11.0 Linux/6.17.0-1020-azure
|
Release files / leistungsbot-1.4.2-py3-none-any.whl
| Download URL | leistungsbot-1.4.2-py3-none-any.whl |
|---|---|
| Size | 5.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
383f814a5cd5241252203fa899ee57dbda525be3412feb2395550587bd787373
|
|
BLAKE2b-256 checksum How to use checksums |
3548e99b7ac9ae883ac93236e7cfa3670ad6fbc38296500eb4e028dd91dfbc19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.11.0 Linux/6.17.0-1020-azure
|
Security for leistungsbot 1.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.