AzadWeek is a lightweight Telegram bot designed to inform users whether the current week is even or odd. Built with PHP, it’s tailored for students, instructors, and anyone needing quick access to this information in a localized Persian calendar format.
- Week status checker: Displays whether the current week is even or odd based on the Persian calendar.
- User data tracking: Saves user states for improved interactions and analysis.
- Admin tools: Manage the bot easily with pre-defined admin roles.
- Simple setup: Deploy and integrate with Telegram in minutes.
Before running the bot, ensure you have:
- PHP 7.4 or later installed on your server.
- A Telegram Bot Token, which you can obtain from BotFather.
- jdf.php library for Persian calendar management (already included in the source code).
- Writable access to the JSON files (
user_states.json
andusers.json
) for storing user data.
-
Clone the repository to your server:
git clone https://github.com/ArianPashae/AzadWeekBot.git
-
Navigate to the project directory:
cd AzadWeek
-
Configure the bot:
- Open
AzadWeek.php
and update the following variables:$token
: Replace with your Telegram Bot Token.$channel_username
: Add your channel username (without@
).$admin_chat_ids
: Add the Telegram IDs of bot admins.
- Open
-
Set up the webhook:
Use the following URL format to link your bot to the server:https://api.telegram.org/bot<YourToken>/setWebhook?url=<YourServerURL>/AzadWeek.php
Example:
https://api.telegram.org/bot123456:ABCDEF/setWebhook?url=https://example.com/AzadWeek.php
AzadWeek/
├── AzadWeek.php # Main bot logic
├── jdf.php # Persian calendar library
├── user_states.json # Tracks user interaction states
├── users.json # Stores user information
- Start the bot: After setting up the webhook, open the bot in Telegram and send
/start
. - Ask the bot: Send messages like "این هفته زوجه؟" or "وضعیت هفته" to get the current week status.
- Admin commands: Admins can manage users and settings by editing the JSON files directly or extending the bot’s logic.
AzadWeek is designed with simplicity and extensibility in mind. Here are some ideas to expand its functionality:
- Add notifications: Notify users about upcoming events or deadlines.
- Custom commands: Implement additional features like semester reminders or personalized messages.
- Multi-language support: Extend the bot to support other languages beyond Persian.
To contribute, fork the repository, make your changes, and submit a Pull Request.
- Webhook not working: Ensure the URL is publicly accessible and SSL-certified.
- No response from bot: Verify that the
$token
is correctly set and matches your bot's token. - Permission denied: Ensure
user_states.json
andusers.json
have write permissions.
We welcome contributions from developers! To get started:
- Fork the repository.
- Create a new branch for your feature:
git checkout -b feature-name
- Commit your changes and push them:
git push origin feature-name
- Open a Pull Request and describe your changes.
This project is licensed under the MIT License.
- Telegram Support: @ArianPashae
- Email: info@arianpashae.com
- WebSite: ArianPashae.com
AzadWeek: Simplifying your schedule, one week at a time. 🚀