This bot is designed to display schedules. It provides a user-friendly interface to select your group and view the schedule for today, tomorrow, yesterday, or the entire week.
The bot offers the following commands and features:
- /start: Initiates interaction with the bot. Prompts you to select your study group using inline buttons.
- /schedule: Displays the main schedule viewing buttons after a group has been selected.
- "Today": Shows the schedule for the current day for the selected group.
- "Tomorrow": Shows the schedule for the next day for the selected group.
- "Yesterday": Displays the schedule for the previous day for the selected group.
- "Week": Presents the schedule for the entire current week for the selected group.
- Group Selection: Upon first launch or using the
/startcommand, the bot will ask you to choose your group (e.g., "1A", "1B", "2A", "2B") via interactive buttons.
To run the bot, you will need to have either Docker or Podman installed on your system. You will also need a BOT_TOKEN from BotFather in Telegram.
- Clone the repository:
git clone https://github.com/TOwInOK/scheduler.git cd scheduler - Create an
.envfile: In the project's root directory, create a file named.envand add your bot token to it:ReplaceBOT_TOKEN=YOUR_SECRET_BOT_TOKEN
YOUR_SECRET_BOT_TOKENwith the actual token you obtained from BotFather.
You can pull the latest pre-built image directly from GitHub Container Registry (GHCR):
# For Docker:
docker pull ghcr.io/towinok/scheduler:latest
# For Podman:
podman pull ghcr.io/towinok/scheduler:latestThis is the most recommended way to manage the bot, simplifying the build/pull and run process.
-
Update
docker-compose.ymlto use the pre-built image: Modify yourdocker-compose.ymlto specify theimageinstead ofbuildif you prefer to use the pre-built image.version: '3.8' services: scheduler: image: ghcr.io/towinok/scheduler:latest # Specify the image to pull container_name: scheduler_bot environment: - BOT_TOKEN=${BOT_TOKEN} restart: on-failure
Then, run:
docker compose up -d
-
To build the image locally (from source) with Docker Compose: Ensure your
docker-compose.ymlspecifiesbuild: .(as provided initially).docker compose up --build -d
This command will build the image (if not already created or if there are changes) and run the container in detached mode.
-
Stop the container:
docker compose down
If you prefer to manage images and containers manually:
-
Run the container using the pre-built image:
# For Docker: docker run -d --name scheduler_bot -e BOT_TOKEN="${BOT_TOKEN}" ghcr.io/towinok/scheduler:latest # For Podman: podman run -d --name scheduler_bot -e BOT_TOKEN="${BOT_TOKEN}" ghcr.io/towinok/scheduler:latest
Important: Ensure that the
BOT_TOKENenvironment variable is available in your current shell before executing theruncommand (e.g.,export BOT_TOKEN="YOUR_SECRET_BOT_TOKEN"or use$(cat .env | grep BOT_TOKEN | cut -d '=' -f2)). -
To build and run the image locally (from source): First, build the image:
# For Docker: docker build . -t scheduler_bot:latest # For Podman: podman build . -t scheduler_bot:latest
Then, run it:
# For Docker: docker run -d --name scheduler_bot -e BOT_TOKEN="${BOT_TOKEN}" scheduler_bot:latest # For Podman: podman run -d --name scheduler_bot -e BOT_TOKEN="${BOT_TOKEN}" scheduler_bot:latest
-
Stopping the container:
# For Docker: docker stop scheduler_bot # For Podman: podman stop scheduler_bot