vad1m4 / tgeb

MIT License
0 stars 0 forks source link

TGEB

TGEB is a Telegram bot written in Python to serve the purpose of notifying subscribers of when there is an electricity outage in their home. It utilizes Termux:API to check for whether it's plugged in or not and notifies subscribers based off that information.

Installation

Termux

Firstly, you'll have to get Termux and Termux:API from F-Droid.

Preparing the workspace

After installing both Termux and Termux:API apps, install git:

pkg install git

And run the following command:

git clone https://github.com/vad1m4/tgeb.git

Now, change your directory by running cd tgeb.

Setting up the bot

To simplify the setting up process, I've created a bash file that will install and set up everything you'll need. To run it, you'll have to make it executable by running the following command:

chmod +x setup.sh

Now, run the script:

./setup.sh

You'll be asked to fill in the following information:

After filling those out, you'll be all set and ready to go. The setup script will run the bot for you.

Usage

To run the bot manually, simply run main.py with python:

python main.py

Debugging

There's an option to debug the bot if you were to add something yourself. To do that, run the bot with the following parameters:

Cautions

Do not distribute the bot's username to people that you don't know or don't trust. Since this bot uses your address to notify people, everybody who subscribes to it will know your address. Ideally, you should only share it with your neighbours.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT