A simple Python tool to export messages from Telegram to Markdown format.
- Connects to Telegram via Telethon
- Exports chat messages to Markdown
- Easy configuration via
config.json
- Python 3.8+
- Telethon
- Clone the repository:
git clone https://github.com/dlxarl/tg2md.git cd tg2md - Create and activate a virtual environment (optional but recommended):
python3 -m venv venv source venv/bin/activate - Install dependencies:
pip install -r requirements.txt
- Set up your Telegram API credentials:
- Run the script. On first launch, you will be prompted for your API ID and API Hash (get them at https://my.telegram.org/auth).
- Credentials are saved in
config.json(which is in .gitignore).
Run the main script:
python main.pyFollow the prompts to authenticate and export messages.
- Do not share your API credentials or session files.