Skip to content
Telegram Bot @RastreioBot
Python
Branch: master
Clone or download
Latest commit f4216b2 Nov 1, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Create FUNDING.yml Oct 3, 2019
tests Remove unnecessary code Oct 20, 2019
.coveragerc Update .coveragerc Oct 19, 2019
.gitignore Merge branch 'master' into master Oct 22, 2019
.travis.yml Update .travis.yml Oct 19, 2019
LICENSE.md Create LICENSE.md Feb 3, 2017
README.md Merge branch 'master' into master Oct 30, 2019
apicorreios.py Merge branch 'master' into keeptrack Oct 30, 2019
apigeartrack.py Merge pull request #69 from GabrielRF/config-sections Oct 22, 2019
apitrackingmore.py
bot.conf_sample Bot.conf_sample Sep 26, 2019
del_one.py Merge pull request #69 from GabrielRF/config-sections Oct 22, 2019
del_routine.py Rotate del routine by time. not by size Nov 1, 2019
firstlog.py Merge pull request #69 from GabrielRF/config-sections Oct 22, 2019
icon.jpg icon upload Feb 3, 2017
misc.py One more tracking format allowed Nov 1, 2019
msgs.py
rastreiobot.png New logo Aug 13, 2018
rastreiobot.py
requirements.txt
routine.py Small change in logs Nov 1, 2019
status.py
stopped.py Merge branch 'master' into keeptrack Oct 30, 2019

README.md

RastreioBot

Build Status Donate Donate Twitter Follow

Rastreiobot

About

This is a Telegram Bot that tracks packages from the Brazilian Mail Service. It runs on Python 3 and uses MongoDB.

Try it!

Setup

First, create a virtual environment for your project (so it don't mixup with your other libraries versions):

python3 -m venv rastreiobotenv

If you don't have it installed, check here

and activate your environment:

. rastreiobotenv/bin/activate

After cloning/downloading the repository, install required packages:

pip install -r requirements.txt

Create a file bot.conf following bot.conf_sample.

TOKEN Bot token generated by BotFather

int_check Minimum interval between checks for the same package (3600 means 1 hour)

*_log Log files

patreon List of people that donate to the bot

Banned List of banned users

usuario User provived by Correios

senha Password provided by Correios

token Token provided by Correios

key Key provided by TrackingMore

url Sentry URL

Run MongoDB!

For RaspberryPi: https://github.com/GabrielRF/Docker-MongoDB-RPi

Run

To receive messages:

python rastreiobot.py

To check for updates, I recommend a cronjob that runs every 15 min.

Type crontab -e and add to the end of the file:

*/15 * * * * cd /usr/local/bin/RastreioBot; /usr/bin/python3 /usr/local/bin/RastreioBot/routine.py 0
*/15 * * * * cd /usr/local/bin/RastreioBot; /usr/bin/python3 /usr/local/bin/RastreioBot/routine.py 1
*/15 * * * * cd /usr/local/bin/RastreioBot; /usr/bin/python3 /usr/local/bin/RastreioBot/routine.py 2
*/15 * * * * cd /usr/local/bin/RastreioBot; /usr/bin/python3 /usr/local/bin/RastreioBot/routine.py 3
...

Running tests

The tests are running on pytest, so, in order to run them, just do

pytest

Contribute

Pull requests and issues are welcome!

Contact

Telegram

Site

You can’t perform that action at this time.