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 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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a94d026306225ddcfd7b4c387bda697b247c54feb3ac114962f088f87c877b10
|
|
| MD5 |
a960194b8b2cf2e9ee7ce9172b0007f2
|
|
| BLAKE2b-256 |
df5948fb97b5fe59fe0bd1707f4be6aa9ac549e8bf5a081995f23954075b657b
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
631d36fd5f60064c29699ad390afaae9f429f860bfed5bb72dc74bb05b7a744f
|
|
| MD5 |
da01b61513981237335dd667031dae84
|
|
| BLAKE2b-256 |
afdb450decc42395ca7a0f8112a45adca0da304cab45fe6a8350a1e19cfae043
|