中文文档 | English
An intelligent medicine reminder system built with Rust and Telegram Bot to help you take medications on time.
- 🏥 Medicine Management: Add, delete, and view medicine information
- ⏰ Smart Reminders: Support multiple reminder times per day
- 🔔 Persistent Reminders: Continuous reminders until confirmation if not acknowledged
- 📊 Medication Records: Automatic tracking of medication intake and remaining quantities
- 💊 Inventory Management: Medicine quantity management with refill reminders
- 🎯 Flexible Quantities: Support for custom medication and refill amounts
- ⚡ Quick Actions: Convenient quick-select buttons for common quantities
- Find @BotFather on Telegram
- Send
/newbotto create a new bot - Follow the prompts to set bot name and username
- Get your Bot Token
- Find @userinfobot on Telegram
- Send any message to get your Chat ID
- Or add the bot to a group and use the group ID
Copy .env.example to .env and fill in your configuration:
cp .env.example .envEdit the .env file:
TELOXIDE_TOKEN=your_bot_token
CHAT_ID=your_chat_id
# Build the project
cargo build --release
# Run the bot
cargo run/help- Show help information/add- Add new medicine/list- View all medicines/delete- Delete medicine/refill- Refill medicine quantity/pending- View pending reminders
- Send
/add - Enter medicine name, e.g.,
Vitamin C - Enter quantity, e.g.,
30 - Enter reminder times, e.g.,
08:00,20:00
When you receive a reminder message:
- Click "✅ Taken" to confirm medication (will show quantity selection interface)
- Click "⏰ Remind Later" to delay reminder by 5 minutes
When confirming medication intake, the system provides:
- Quick Select: 1 pill, 2 pills, 3 pills
- Custom Amount: Enter any quantity
When using the /refill command, the system provides:
- Quick Select: 10, 20, 30 units
- Custom Amount: Enter any quantity
- First Reminder: Prompt reminder at scheduled time
- Second Reminder: Remind again if not confirmed within 5 minutes
- Third Reminder: Remind again if not confirmed within 10 minutes
- Subsequent Reminders: Remind every 15 minutes until confirmed
All data is saved in the medicine_data.json file, including:
- Medicine information (name, quantity, reminder times)
- Pending reminder records
src/
├── main.rs # Main program entry
├── lib.rs # Module declarations
├── bot.rs # Telegram Bot handling logic
├── medicine.rs # Medicine data structures
├── reminder.rs # Reminder system logic
└── storage.rs # Data persistence
teloxide- Telegram Bot frameworktokio- Async runtimeserde- Serialization/deserializationchrono- Time handlinguuid- Unique ID generation
- Ensure the bot has permission to send messages
- Keep the program running to receive and send reminders
- Regularly backup the
medicine_data.jsonfile - Time format must be HH:MM (24-hour format)
-
Bot Not Responding
- Check if the Token is correct
- Confirm network connection is working
-
Not Receiving Reminders
- Check if Chat ID is correct
- Confirm the program is running
-
Time Format Error
- Use 24-hour format: 08:00, 20:30
- Separate multiple times with commas
MIT License