pogoraidbot


Namepogoraidbot JSON
Version 0.4.14 PyPI version JSON
download
home_pagehttps://github.com/RobertoBochet/pogoraidbot
SummaryA telegram bot to organize PoGo raid that it can be self hosted
upload_time2020-09-19 16:22:22
maintainer
docs_urlNone
authorRoberto Bochet
requires_python>=3.6
licensegpl-3.0
keywords game pokemongo pogo pokemongo-raid telegram telegrambot
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Codacy Badge](https://app.codacy.com/project/badge/Grade/dcfaeb382e18477491720692ea2f818f)](https://www.codacy.com/manual/RobertoBochet/pogoraidbot?utm_source=github.com&utm_medium=referral&utm_content=RobertoBochet/pogoraidbot&utm_campaign=Badge_Grade)
[![GitHub](https://img.shields.io/github/license/robertobochet/pogoraidbot?color=blue)](https://github.com/RobertoBochet/pogoraidbot/blob/master/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/pogoraidbot?color=yellow&label=pypi%20version)](https://pypi.org/project/pogoraidbot/)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/robertobochet/pogoraidbot/Upload%20Python%20Package?label=pypi%20build)](https://pypi.org/project/pogoraidbot/)
[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/robertobochet/pogoraidbot?color=blue&label=docker%20version&sort=semver)](https://hub.docker.com/r/robertobochet/pogoraidbot)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/robertobochet/pogoraidbot/Publish%20Docker%20Image?label=docker%20build)](https://hub.docker.com/r/robertobochet/pogoraidbot)

## 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`:

```bash
$ 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](https://github.com/tesseract-ocr/tesseract).

### Redis

The bot requires a dedicated instance of Redis database.

Refer to this [link](https://redis.io/).

## Run

The bot needs to know, the bot api token, that you can obtain from [@BotFather](https://telegram.me/BotFather) and the address of redis instance.

To understand how to provide these information to the bot:

```bash
$ python3 -m pogoraidbot
```

```bash
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:

```bash
$ 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](https://docs.docker.com/compose/install/).

### Installation

You can choose two kinds of setup:

#### Use the image on Docker Hub

1. Download **.env** and **docker-compose.yaml** files and put them in a folder.

2. Edit them to adapt the setup to your requirements(see below).

3. Run the containers.

    ```bash
    docker-compose up
    ```

#### Compile your own Docker image 

1. Clone the whole repo and init the submodule.

    ```bash
    git clone https://github.com/RobertoBochet/pogoraidbot-dockerized.git ./pogoraidbot
    cd pogoraidbot
    git submodule update --init
    ```

2. Edit the **.env** and **docker-compose.yaml** to adapt the setup to your requirements(see below).

3. Build and start the containers.

    ```bash
    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](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) table on column *TZ database name*)

#### Optional

- Add support to gym identification

    In **.env** set the env `PGRB_BOT_GYMS_FILE` with the position of your gyms file.

- Add support to boss identification

    In **.env** set the env `PGRB_BOT_BOSSES_FILE` with 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](https://python-telegram-bot.org/) (LGPLv3 License)
-   [opencv-python](https://pypi.org/project/opencv-python/) (MIT License)
-   [pytesseract](https://pypi.org/project/pytesseract/) (GPLv3 License)
-   [redis](https://pypi.org/project/redis/) (MIT License)
-   [requests](https://pypi.org/project/requests/) (Apache 2.0 License)



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/RobertoBochet/pogoraidbot",
    "name": "pogoraidbot",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "game,pokemongo,pogo,pokemongo-raid,telegram,telegrambot",
    "author": "Roberto Bochet",
    "author_email": "robertobochet@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/59/42/50932c416310449d3f8c402ef3eac7d42eb71e7cadd53822cb0e418cb5de/pogoraidbot-0.4.14.tar.gz",
    "platform": "",
    "description": "[![Codacy Badge](https://app.codacy.com/project/badge/Grade/dcfaeb382e18477491720692ea2f818f)](https://www.codacy.com/manual/RobertoBochet/pogoraidbot?utm_source=github.com&utm_medium=referral&utm_content=RobertoBochet/pogoraidbot&utm_campaign=Badge_Grade)\n[![GitHub](https://img.shields.io/github/license/robertobochet/pogoraidbot?color=blue)](https://github.com/RobertoBochet/pogoraidbot/blob/master/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/pogoraidbot?color=yellow&label=pypi%20version)](https://pypi.org/project/pogoraidbot/)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/robertobochet/pogoraidbot/Upload%20Python%20Package?label=pypi%20build)](https://pypi.org/project/pogoraidbot/)\n[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/robertobochet/pogoraidbot?color=blue&label=docker%20version&sort=semver)](https://hub.docker.com/r/robertobochet/pogoraidbot)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/robertobochet/pogoraidbot/Publish%20Docker%20Image?label=docker%20build)](https://hub.docker.com/r/robertobochet/pogoraidbot)\n\n## Important\n\n**The bot is now in beta version**\n\n## Description\n\nA telegram bot to organize PoGo raid that it can be self hosted.\n\nIf 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.\n\n## Requirements\n\n### Python\n\nThe bot needs Python version 3.7 or newer.\n\nYou can install `pogoraidbot` from `pypi`:\n\n```bash\n$ pip install pogoraidbot\n```\n\n### Tesseract\n\nThe 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.\n\nRefer to this [link](https://github.com/tesseract-ocr/tesseract).\n\n### Redis\n\nThe bot requires a dedicated instance of Redis database.\n\nRefer to this [link](https://redis.io/).\n\n## Run\n\nThe bot needs to know, the bot api token, that you can obtain from [@BotFather](https://telegram.me/BotFather) and the address of redis instance.\n\nTo understand how to provide these information to the bot:\n\n```bash\n$ python3 -m pogoraidbot\n```\n\n```bash\nusage: pogoraidbot [-h] [-t TOKEN] [-r REDIS] [-a SUPERADMIN] [-b BOSSES_FILE] [-o BOSSES_EXPIRATION]\n                   [-g GYMS_FILE] [-y GYMS_EXPIRATION] [-e] [-d DEBUG_FOLDER] [-v] [--info] [--debug]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -t TOKEN, --token TOKEN\n                        telegram bot token\n  -r REDIS, --redis REDIS\n                        redis url in \"redis://{host}[:port]/{db}\" format\n  -a SUPERADMIN, --superadmin SUPERADMIN\n                        superadmin's id\n  -b BOSSES_FILE, --bosses-file BOSSES_FILE\n                        JSON or CSV file contains possible pok\u00e9mons in the raids. It can be also\n                        provided over http(s)\n  -o BOSSES_EXPIRATION, --bosses-expiration BOSSES_EXPIRATION\n                        Validity of the bosses list in hours\n  -g GYMS_FILE, --gyms-file GYMS_FILE\n                        JSON file contains gyms and their coordinates. It can be also provided over\n                        http(s)\n  -y GYMS_EXPIRATION, --gyms-expiration GYMS_EXPIRATION\n                        Validity of the gyms list in hours\n  -e, --env             Use environment variables for the configuration\n  -d DEBUG_FOLDER, --debug-folder DEBUG_FOLDER\n                        debug folder\n  -v                    number of -v specifics level of verbosity\n  --info                equal to -vv\n  --debug               equal to -vvv\n```\n\nAn example:\n\n```bash\n$ python3 -m pogoraidbot -t [BOT_TOKEN] -r redis://192.168.15.2:4044/3\n```\n\n## Dockerized version \\[recommended]\n\n### Requirements\n\nThe dockerized version of the bot requires `docker` and `docker-compose` to work.\n\nRefer to this [link](https://docs.docker.com/compose/install/).\n\n### Installation\n\nYou can choose two kinds of setup:\n\n#### Use the image on Docker Hub\n\n1. Download **.env** and **docker-compose.yaml** files and put them in a folder.\n\n2. Edit them to adapt the setup to your requirements(see below).\n\n3. Run the containers.\n\n    ```bash\n    docker-compose up\n    ```\n\n#### Compile your own Docker image \n\n1. Clone the whole repo and init the submodule.\n\n    ```bash\n    git clone https://github.com/RobertoBochet/pogoraidbot-dockerized.git ./pogoraidbot\n    cd pogoraidbot\n    git submodule update --init\n    ```\n\n2. Edit the **.env** and **docker-compose.yaml** to adapt the setup to your requirements(see below).\n\n3. Build and start the containers.\n\n    ```bash\n    docker-compose build\n    docker-compose up\n    ```\n\n### Configuration\n\n#### Required\n\nIn **.env** replace:\n\n- `[BOT_TOKEN]` with your bot's token\n- `[SUPERADMIN_ID]` with the Telegram id of the main admin\n- `[TIME_ZONE]` with your time zone (refer to [this](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) table on column *TZ database name*)\n\n#### Optional\n\n- Add support to gym identification\n\n    In **.env** set the env `PGRB_BOT_GYMS_FILE` with the position of your gyms file.\n\n- Add support to boss identification\n\n    In **.env** set the env `PGRB_BOT_BOSSES_FILE` with the position of your bosses file.\n\n- Make **redis** data persistent\n\n    Uncomment the line `command: [\"redis-server\", \"--appendonly\", \"yes\"] ` in **docker-compose.yaml**.\n\n    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`.\n\n- Assign static IP for the virtual network\n\n    Uncomment all the three **networks** sections in **docker-compose.yaml** and set the three env `PGRB_NETWORK_*` with *IP* and *subnet* in **.env**.\n\n## Credits\n\nIn this project are used the following Python libraries:\n\n-   [python-telegram-bot](https://python-telegram-bot.org/) (LGPLv3 License)\n-   [opencv-python](https://pypi.org/project/opencv-python/) (MIT License)\n-   [pytesseract](https://pypi.org/project/pytesseract/) (GPLv3 License)\n-   [redis](https://pypi.org/project/redis/) (MIT License)\n-   [requests](https://pypi.org/project/requests/) (Apache 2.0 License)\n\n\n",
    "bugtrack_url": null,
    "license": "gpl-3.0",
    "summary": "A telegram bot to organize PoGo raid that it can be self hosted",
    "version": "0.4.14",
    "split_keywords": [
        "game",
        "pokemongo",
        "pogo",
        "pokemongo-raid",
        "telegram",
        "telegrambot"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "2e2901387b8ef1c39a0b41fb60698aef",
                "sha256": "5b25e6fdd4c5e57f85e2b23fca2c727590d01954713e48eb8bde1fd6d858d965"
            },
            "downloads": -1,
            "filename": "pogoraidbot-0.4.14-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2e2901387b8ef1c39a0b41fb60698aef",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 44561,
            "upload_time": "2020-09-19T16:22:21",
            "upload_time_iso_8601": "2020-09-19T16:22:21.211035Z",
            "url": "https://files.pythonhosted.org/packages/16/0b/02dff80f7fbc25f321a86f8a3147ce1357be4288b171d9c731899cb7151c/pogoraidbot-0.4.14-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "122d6714a5303e26794b3d1975a95315",
                "sha256": "e9d4d023e8b6273c10c13682c18cb985725902185e99b37927900159fd65108a"
            },
            "downloads": -1,
            "filename": "pogoraidbot-0.4.14.tar.gz",
            "has_sig": false,
            "md5_digest": "122d6714a5303e26794b3d1975a95315",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 31926,
            "upload_time": "2020-09-19T16:22:22",
            "upload_time_iso_8601": "2020-09-19T16:22:22.360504Z",
            "url": "https://files.pythonhosted.org/packages/59/42/50932c416310449d3f8c402ef3eac7d42eb71e7cadd53822cb0e418cb5de/pogoraidbot-0.4.14.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-09-19 16:22:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "RobertoBochet",
    "error": "Could not fetch GitHub repository",
    "lcname": "pogoraidbot"
}
        
Elapsed time: 0.19178s