A simple Telegram bot that allows you to import highlighted text from Kindle to Telegram and receive random highlights as messages. You can schedule the bot to send you a random highlight at regular intervals, or manually request a highlight.
- Import Highlights: Upload a
.txt
file containing your Kindle highlights, and the bot will process and store them. - Receive Highlights: Use commands to request random highlights from your imported collection.
- Scheduled Highlights: Set up a schedule to receive random highlights at regular intervals (e.g., every 1 minute, 5 minutes, etc.).
- Manage Schedules: Easily set or delete highlight schedules through bot commands.
- Python 3.8+
- A Telegram account and a Telegram Bot API token (see instructions below)
- Go to BotFather on Telegram.
- Use
/newbot
to create a new bot and get the API token. - Copy the token, as you will need it later.
Clone this repository to your local machine:
git clone https://github.com/hungnguyen7/kindle-highlight-telegram-bot.git
cd kindle-highlight-telegram-bot
Install the required Python packages:
pip install -r requirements.txt
- Create a new file named
.env
in the project root directory. - Add the following lines to the
.env
file:
BOT_TOKEN=your_bot_token_here
Replace your_bot_token_here
with the API token you received from BotFather.
Start the bot by running the following command:
python bot.py
The bot should now be running and ready to receive commands.
The bot supports the following commands:
/start
: Start the bot and view the available commands./help
: View the available commands./import
: Import a.txt
file containing Kindle highlights./highlight
: Get a random highlight from your collection./schedule
: Set up a schedule to receive random highlights at regular intervals./unschedule
: Stop receiving scheduled highlights.