{"id":20909907,"url":"https://github.com/escalopa/gopray","last_synced_at":"2025-03-12T22:15:17.136Z","repository":{"id":65211272,"uuid":"585132082","full_name":"escalopa/gopray","owner":"escalopa","description":"A Telegram Bot to get muslim prayer's time in Kazan Russia, And subscribe to get notified on upcoming prayers, Built with golang","archived":false,"fork":false,"pushed_at":"2024-11-11T21:49:28.000Z","size":383,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T15:20:05.327Z","etag":null,"topics":["muslim-prayer-times","redis","subscriptions","telegram-bot"],"latest_commit_sha":null,"homepage":"https://t.me/kz_prayers_bot","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/escalopa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-04T11:58:55.000Z","updated_at":"2024-11-11T21:49:32.000Z","dependencies_parsed_at":"2023-12-31T19:32:45.568Z","dependency_job_id":"6d00acf1-b62b-4175-8fb0-34ad0acd509a","html_url":"https://github.com/escalopa/gopray","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escalopa%2Fgopray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escalopa%2Fgopray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escalopa%2Fgopray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escalopa%2Fgopray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/escalopa","download_url":"https://codeload.github.com/escalopa/gopray/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243301122,"owners_count":20269286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["muslim-prayer-times","redis","subscriptions","telegram-bot"],"created_at":"2024-11-18T14:13:12.152Z","updated_at":"2025-03-12T22:15:17.114Z","avatar_url":"https://github.com/escalopa.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gopray 🙏\n\nA Telegram Bot to get muslim prayers time, And subscribe to get notified on the prayers time\n\n![Build status](https://github.com/escalopa/gopray/workflows/Deploy/badge.svg)\n[![wakatime](https://wakatime.com/badge/user/965e81db-2a88-4564-b236-537c4a901130/project/5b8bc34a-26b1-4a61-be8d-f9b854b1e43a.svg)](https://wakatime.com/badge/user/965e81db-2a88-4564-b236-537c4a901130/project/5b8bc34a-26b1-4a61-be8d-f9b854b1e43a)\n[![Report card](https://goreportcard.com/badge/github.com/escalopa/gopray)](https://goreportcard.com/report/github.com/escalopa/gopray)\n[![codecov](https://codecov.io/gh/escalopa/gopray/branch/v3/graph/badge.svg?token=xpSEiuk0s8)](https://codecov.io/gh/escalopa/gopray)\u003cimg src=\"./cover.jpg\"\u003e\n\n## Contributing 🤼\n\nBefore we start talking about the bot, I would really appreciate if you can contribute to this project by adding more features or fixing bugs. It is totally open source and free to use. 😁\n\n## Usecase 🛠️\n\n```mermaid\ngraph LR\nA[User] --\u003e |Get Prayers Time| B((Bot))\nA[User] --\u003e |Subscribe To Bot| B((Bot))\nA[User] --\u003e |Change Bot Language| B((Bot))\nB((Bot)) --\u003e |Notify Users about prayers| B((Bot))\nA[User] --\u003e |Send Feedback Messages\\nOr Bug Reports| B((Bot))\nB((Bot)) --\u003e |Store Prayers Time| D[[Run Time Memory]]\nB((Bot)) --\u003e |Store User ID For Subscriptions| C[[Database]]\n```\n\n## Subscription Feature 📢\n\nThis feature allows the bot to notify users `20 min` before the prayers time. (Time is set by the `UPCOMING_REMINDER` env variable)\n\nUsers can subscribe to the bot by sending `/subscribe` command to the bot. And unsubscribe by sending `/unsubscribe` command to the bot.\n\nAlso on friday the bot will remind the user to pray Gomaa prayer. at `7:00 PM` (Time is set by the `GOMOAA_REMINDER_HOUR` env variable), This is value to when to remind them, The prayer time is calculated based on the prayers time of the day and sent to the user.\n\n### How it works 🤔\n\nIn order to implement this feature, We have to make to bot wait until `20 min` are left before the prayer's time. And then send a notification to the subscribed users.\n\nAlso, when the time of the prayer's arrive we should also notify them.\n\nSo for that I use simple `channels` to sleep the goroutine until the time is right to send the notification.\n\nThe first sleep is until the `20 min` before the prayer's time. And the second is until the prayer's time.\n\nfor more details check the [notifier code](./telegram/internal/adapters/notifier/notifier.go).\n\n## Bot Options 🤖\n\n### Default Commands 📝\n\n| Command      | Description                                         |\n|--------------|-----------------------------------------------------|\n| /help        | Get help message showing all possible commands      |\n| /prayers     | Get prayers time                                    |\n| /date        | Get prayers time by date                            |\n| /subscribe   | Subscribe to get notified on the prayers time       |\n| /unsubscribe | Unsubscribe to not get notified on the prayers time |\n| /lang        | Change the bot language (Default English)           |\n| /feedback    | Send feedback to the bot owner                      |\n| /bug         | Report a bug to the bot owner                       |\n\n### Admin Commands 📝\n\n| Command  | Description                        |\n|----------|------------------------------------|\n| /subs    | Get subscribers count              |\n| /sall    | Send message to all subscribers    |\n| /respond | Respond to feedback or bug message |\n\n## References 📚\n\n- [Telegram API (Telego)](https://github.com/SakoDroid/telego)\n- [Prayer Times Site](http://dumrt.ru/ru/help-info/prayertime/)\n\n\n## Upcoming Features 🚀\n\n### Version 1 Milestones 🏁\n- [x] Support date format for `/prayersdate` command with leading zeros and with delimiters (. / -)\n- [x] Implement subscriptions \u0026 notifications\n- [x] Update text messages to be more user-friendly\n\n### Version 2 Milestones 🏁\n- [x] store prayers time in memory to reduce the number of requests to the database since the prayers time is not changing\n- [x] make response endpoint for admin to respond to feedback \u0026 bug messages\n- [x] remind about gomaa prayer on friday\n\n### Version 3 Milestones 🏁\n- [x] Add time keyboard to `/date` command\n- [x] Remove selection message for `/date` \u0026 `/lang` after the use interacts with the message or timeout\n- [x] On new user commands terminate other going channels that are listening to the chat\n- [x] Add feature to delete old prayer time message when new one is sent\n- [x] Add feature to send all subscribers a message from admin\n- [x] Add feature to get count of subscribers for admin\n- [x] Write more robust tests for core features\n\n### Version 4 Milestones 🏁\n- [x] Add different languages support (AR, RU, TT, TR, UZ)\n- [x] Use script messages in the bot\n- [x] Set user script before command if nor set\n- [x] USe script commands in notifications\n- [x] Fix prayers timetable for other languages\n\n### Version 5 Milestones 🏁\n- [x] Refactor the code to be more readable and maintainable\n- [x] Enhance logging to be more informative and useful\n- [x] Enable using many bot in the same code\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescalopa%2Fgopray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fescalopa%2Fgopray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescalopa%2Fgopray/lists"}