telegram_bot
This bot is currently a beta project.
Features
A telegram bot which can:
- Send current COVID-19 cases/stats of Germany
- Send current worth of major crypto currencies
- Send a random meme
Important information
If you are using Windows, type 'python' instead of 'python3'. Otherwise it propably won't work.
Setup
First, you need to git clone this repository. On Windows you might have to install git but you can also just download this repo from the website.
git clone https://github.com/huhncares-cmd/telegram_bot
After that, you need to setup your virtual environment.
python3 -m venv venv
On Linux you might have to install python3-venv first. SImply type in this command:
sudo apt install python3-venv
On Windows you can jump into the environment like that on cmd:
venv\Scripts\activate.bat
And on Powershell:
venv\Scripts\Activate.ps1
On Linux it's a bit different because there are many shells out there. You can see what's right for you on the official website of Python (https://docs.python.org/3/library/venv.html), but for most users this command will work:
source venv/bin/activate
Install requirements
When you are in your virtual environment, you can simply install all dependencies using this command:
pip3 install -r requirements.txt
Generate API-Token
You need an API-Token to access the Telegram-API. You can get this API-Token by sending a message to @BotFather (https://t.me/BotFather). Just write /start
and follow the instructions of the bot.
Setting up environment variables
After getting the API-Token you need to setup your environment variables. Create a .env file in your base directory and type in the following stuff.
TELEGRAM_API_KEY =
Make Sure to exclude this file with .gitignore if you want to use Git later.
Run
You can run the bot by executing main.py.
python3 main.py
Finish
That's basicly it. You've just set up your own Telegram bot. Feedback on Twitter (https://twitter.com/huhncares) or GitHub (https://github.com/huhncares-cmd) is appreciated. Thanks for using huhncares-cmd/telegram_bot!