Important
The bot is now in beta version
Description
A telegram bot to organize PoGo raid that it can be self hosted.
If you publish a raid screenshot in a group where this bot is present, it identifies the raid an provides you a poll to organize the raid.
Requirements
Python
The bot needs Python version 3.7 or newer.
You can install pogoraidbot from pypi:
$ pip install pogoraidbot
Tesseract
The bot needs an installation of Tesseract OCR and a pre-trained neural network for english. Both can be found from the official Arch and Ubuntu repositories.
Refer to this link.
Redis
The bot requires a dedicated instance of Redis database.
Refer to this link.
Run
The bot needs to know, the bot api token, that you can obtain from @BotFather and the address of redis instance.
To understand how to provide these information to the bot:
$ python3 -m pogoraidbot
usage: pogoraidbot [-h] [-t TOKEN] [-r REDIS] [-a SUPERADMIN] [-b BOSSES_FILE] [-o BOSSES_EXPIRATION]
[-g GYMS_FILE] [-y GYMS_EXPIRATION] [-e] [-d DEBUG_FOLDER] [-v] [--info] [--debug]
optional arguments:
-h, --help show this help message and exit
-t TOKEN, --token TOKEN
telegram bot token
-r REDIS, --redis REDIS
redis url in "redis://{host}[:port]/{db}" format
-a SUPERADMIN, --superadmin SUPERADMIN
superadmin's id
-b BOSSES_FILE, --bosses-file BOSSES_FILE
JSON or CSV file contains possible pokémons in the raids. It can be also
provided over http(s)
-o BOSSES_EXPIRATION, --bosses-expiration BOSSES_EXPIRATION
Validity of the bosses list in hours
-g GYMS_FILE, --gyms-file GYMS_FILE
JSON file contains gyms and their coordinates. It can be also provided over
http(s)
-y GYMS_EXPIRATION, --gyms-expiration GYMS_EXPIRATION
Validity of the gyms list in hours
-e, --env Use environment variables for the configuration
-d DEBUG_FOLDER, --debug-folder DEBUG_FOLDER
debug folder
-v number of -v specifics level of verbosity
--info equal to -vv
--debug equal to -vvv
An example:
$ python3 -m pogoraidbot -t [BOT_TOKEN] -r redis://192.168.15.2:4044/3
Dockerized version [recommended]
Requirements
The dockerized version of the bot requires docker and docker-compose to work.
Refer to this link.
Installation
You can choose two kinds of setup:
Use the image on Docker Hub
-
Download .env and docker-compose.yaml files and put them in a folder.
-
Edit them to adapt the setup to your requirements(see below).
-
Run the containers.
docker-compose up
Compile your own Docker image
-
Clone the whole repo and init the submodule.
git clone https://github.com/RobertoBochet/pogoraidbot-dockerized.git ./pogoraidbot cd pogoraidbot git submodule update --init
-
Edit the .env and docker-compose.yaml to adapt the setup to your requirements(see below).
-
Build and start the containers.
docker-compose build docker-compose up
Configuration
Required
In .env replace:
[BOT_TOKEN]with your bot's token[SUPERADMIN_ID]with the Telegram id of the main admin[TIME_ZONE]with your time zone (refer to this table on column TZ database name)
Optional
-
Add support to gym identification
In .env set the env
PGRB_BOT_GYMS_FILEwith the position of your gyms file. -
Add support to boss identification
In .env set the env
PGRB_BOT_BOSSES_FILEwith the position of your bosses file. -
Make redis data persistent
Uncomment the line
command: ["redis-server", "--appendonly", "yes"]in docker-compose.yaml.If you want make the redis data persistent also to container destruction uncomment also the volumes section of the redis service and set the env
PGRB_REDIS_PATH. -
Assign static IP for the virtual network
Uncomment all the three networks sections in docker-compose.yaml and set the three env
PGRB_NETWORK_*with IP and subnet in .env.
Credits
In this project are used the following Python libraries:
- python-telegram-bot (LGPLv3 License)
- opencv-python (MIT License)
- pytesseract (GPLv3 License)
- redis (MIT License)
- requests (Apache 2.0 License)
Metadata
Release files for pogoraidbot 0.4.14
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 |
|---|---|---|---|---|
| pogoraidbot-0.4.14.tar.gz | 31.9 kB | Without provenance | Details for pogoraidbot-0.4.14.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pogoraidbot-0.4.14-py3-none-any.whl | Python 3 | none | any | Details for pogoraidbot-0.4.14-py3-none-any.whl |
Total release size: 76.5 kB
Release files / pogoraidbot-0.4.14.tar.gz
| Download URL | pogoraidbot-0.4.14.tar.gz |
|---|---|
| Size | 31.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e9d4d023e8b6273c10c13682c18cb985725902185e99b37927900159fd65108a
|
|
BLAKE2b-256 checksum How to use checksums |
594250932c416310449d3f8c402ef3eac7d42eb71e7cadd53822cb0e418cb5de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
|
Release files / pogoraidbot-0.4.14-py3-none-any.whl
| Download URL | pogoraidbot-0.4.14-py3-none-any.whl |
|---|---|
| Size | 44.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b25e6fdd4c5e57f85e2b23fca2c727590d01954713e48eb8bde1fd6d858d965
|
|
BLAKE2b-256 checksum How to use checksums |
160b02dff80f7fbc25f321a86f8a3147ce1357be4288b171d9c731899cb7151c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
|
Security for pogoraidbot 0.4.14
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.