This is a simple Telegram bot that splits long messages into smaller parts (230 characters each) and numbers them for easy readability. It's perfect for splitting long threads or text into smaller, tweet-sized pieces.
- Splits messages longer than 230 characters into smaller chunks.
- Adds numbering to each chunk for better organization.
- Responds in Markdown formatting for clean and clear output.
- Easy-to-use
/startcommand to get started.
- Send a long message to the bot.
- The bot will split it into smaller parts, each 230 characters or less.
- Each part is sent back with a numbered label.
- Python 3.10 or above
- A Telegram bot token (you can create one using BotFather)
python-telegram-botlibrary version 20 or above.envfile to store your bot token securely
-
Clone this repository:
git clone https://github.com/DevMohammad-SA/Thread-Breaker-Bot.git cd Thread-Breaker-Bot -
Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile and add your bot token:BOT_TOKEN=your-telegram-bot-token
-
Run the bot:
python bot.py
Splits a long message into chunks of 230 characters using Python's textwrap module.
Greets the user and explains the bot's purpose.
Processes incoming text messages, splits them, and sends the parts back with numbering.
Input:
This is a very long message that needs to be split into smaller chunks because it exceeds the 230-character limit. The bot will take care of splitting it and numbering each part for you.
Output:
[1]
This is a very long message that needs to be split into smaller chunks because it exceeds the 230-character limit.
[2]
The bot will take care of splitting it and numbering each part for you.
Feel free to submit issues or pull requests. Contributions are always welcome!
For any inquiries, reach out to me on Telegram or open an issue on this repository.