A serverless Telegram bot that provides Muslim prayer times and sends notifications when prayers are approaching.
| City | Bot |
|---|---|
| Kazan | @kazan_prayer_bot |
| Innopolis | @innopolis_prayer_bot |
This bot is completely serverless, utilizing Yandex Cloud Functions for operation and YDB for data storage.
For infrastructure configuration details, check the terraform file.
Bot configuration is managed through environment variables.
Below is an example of an APP_CONFIG value containing all bot information:
{
"648252": {
"bot_id": 648252, // Bot ID
"owner_id": 1385434843, // Bot owner ID
"location": "Europe/Moscow", // Timezone of the city
"token": "oa7GmLW3fncbOE0MTfV0mKxH/F37cShhxgZ1mjl614w", // Telegram token
"secret": "Noe&uPcwjaAxjqJU_JP4C^g2V7ZDQX" // Secret key to verify requests
},
...
}- To find your owner ID, use ID bot
- Bot ID is the first number before
:in the bot token- TOKEN:
123456789:ABC-DEF1234ghIkl-zyx57W2v1u123ew11 - Bot ID:
123456789
- TOKEN:
| Command | Description |
|---|---|
| today | Get today's prayer times |
| date | Get prayer times for a specific date |
| next | Find out the next prayer time |
| subscribe | Subscribe to daily reminders |
| unsubscribe | Unsubscribe from daily reminders |
| remind | Set reminder offset for the next prayer |
| language | Change the bot language |
| help | Show help message |
| bug | Report a problem to bot owner |
| feedback | Send feedback to bot owner |
| Command | Description |
|---|---|
| admin | Show admin help message |
| stats | View bot usage statistics |
| announce | Send message to all users |
| reply | Reply to user's bug/feedback message |
You do:
- Get prayer times for a city in CSV format
- Make a pull request (or open an issue) with the new file
I do:
- Create a new Telegram bot
- Upload the city file to storage bucket
You do:
- Create translation text for the following files:
- ./serverless/reminder/internal/handler/languages/text.yaml
- ./serverless/dispatcher/internal/handler/languages/en.yaml (replace
enwith the new language code)
I do:
- Deploy a new version of the code
Found a bug? Want to add a new feature? Just open an issue or submit a pull request.
- Support date format for
/prayersdatecommand with leading zeros and delimiters (. / -) - Implement subscriptions & notifications
- Update text messages to be more user-friendly
- Store prayer times in memory to reduce database requests
- Add response endpoint for admin to address feedback & bug messages
- Add Jumu'ah prayer reminders on Fridays
- Add time keyboard to
/datecommand - Remove selection message for
/date&/langafter user interaction or timeout - Terminate other active channels when user sends new commands
- Add feature to delete old prayer time message when a new one is sent
- Enable admins to broadcast messages to all subscribers
- Add feature to get subscriber count for admins
- Write more robust tests for core features
- Add multi-language support (AR, RU, TT, TR, UZ)
- Implement script messages in the bot
- Set user script before command if not set
- Use script commands in notifications
- Fix prayer timetables for other languages
- Refactor code for better readability and maintainability
- Enhance logging to be more informative
- Enable using multiple bots with the same codebase
- Migrate to serverless architecture
- Automate deployment using Terraform
- Add support for multiple cities
- Add Spanish & French language support
- Add
/statscommand for bot usage statistics
- Add jamaat gathering feature for group chats
- Add support for all major world cities
terraform plan -out plan.out
terraform show -json plan.out > plan.json
docker run --rm -it -p 9000:9000 -v $(pwd)/plan.json:/src/plan.json im2nguyen/rover:latest -planJSONPath=plan.jsonexport AWS_ACCESS_KEY_ID=$(jq -r '.aws_access_key_id' key.json)
export AWS_SECRET_ACCESS_KEY=$(jq -r '.aws_secret_access_key' key.json)
