This project is a Telegram bot that converts text to and from Morse code and can generate Morse code audio.
bot.py
: Main bot script (contains the Telegram client initialization, command handlers, andgenerate_morse_audio
which uses pydub).morse.py
: Containsencrypt
anddecrypt
functions for Morse code conversion credit to Geeks4Geeks for this code. Source.requirements.txt
: Project dependencies..env
: Environment variables (API credentials).user_configs.json
: Stores user-specific configuration for generating audio.
-
Install dependencies:
pip install -r requirements.txt
-
Set up API credentials in .env or rename sample.env.
- API ID: Obtain from my.telegram.org
- API Hash: Obtain from my.telegram.org
- Bot Token: Obtain from @BotFather
-
Run the app with
python3 bot.py