A tailor made (and mediocre) Telegram Bot written in Python 3.
- Register your bot with @botfather. Refer to Telegram's documentation.
- Clone the repo.
- Setup virtualenv.
python3 -m venv .env
source .env/bin/activate
- Install from requirements.txt
cd chaddi-tg
pip install -r requirements.txt
- Create
config.py
insrc/
- Add
src/config.py
with relevant information
# Bot Username
bot_username = "ChaddiBot"
# Telegram Bot API Token
tg_bot_token = "YOUR-TG-BOT-API-TOKEN-HERE"
# Telegram Webhook URL
tg_webhook_url = "https://chaddibot.com/"
# Whether runnning as dev or not
is_dev = True
# Choose which Text to Speech Engine to use.
tts_engine = "gTTS" # Google TTS
- Run locally with
python bot_chaddi.py
. - Run in prod with
./run_prod.sh
.
The /mom
handler uses spaCy library. It needs to be installed with the English language model.
python -m spacy download en_core_web_sm
WebM files are converted into mp4 by src/handlers/webm_converter.py
using ffmpeg. Make sure to install that.
Refer to python-telegram-bot's official documentation
To check if your setup is correct, do a GET at https://api.telegram.org/bot{my_bot_token}/getWebhookInfo
.