Skip to content

Telegram bot for sending predefined learning materials with some periodicity

License

Notifications You must be signed in to change notification settings

akryvtsun/guru-bot

Repository files navigation

guru-bot

Actions Status codecov GitHub Release

Description

Telegram bot for sending to a subscriber predefined learning information on a daily basis.

All learning information is a course. Each course consists of daily periods and each period has materials. The material has a time of publication inside a day and set of items for publication. Each item might be a Markdown text, image or video.

Configuration

The bot configuration consists of JSON file with the name config.json and possible image(s) and video(s) files.

config.json has structure

{
  "periods": [ ]
}

Here an array of periods defines a course. Each period has a structure

{
  "materials": [ ]
}

And a material looks like

{
  "time": "19:30:00",
  "items": [ ]
}

Individual items might be a text

{ "text": "Some **Markdown** text with emoji \uD83D\uDE09" }

an image

{ "image": "URL to image file" }

and a video

{ "video": "URL to video file" }

Typical course file structure looks like

.
|____course
| |____video
| | |____video_1.mp4
| | |____video_2.mp4
| |____image
| | |____image_1.png
| | |____image_2.png
| | |____image_3.png
| |____config.json

Build

How to build

./gradlew build

or build without tests

./gradlew build -x test

How to create Docker image

docker build --platform linux/amd64 -t guru-bot .

Make label

docker tag guru-bot:latest akryvtsun/guru-bot:latest

Docker Hub push

docker push akryvtsun/guru-bot:latest

Run

Environment variables:

BOT_TOKEN = <Telegram API developer token>
BOT_DEBUG = true/false

Running Docker container (don't do this on Apple Silicon)

  docker run -d --name guru-bot-container \
  -e BOT_TOKEN="bot token" \
  -e BOT_DEBUG="true" \
  -v <path to 'course' folder on a host computer>:/use/local/guru-bot/course \
  guru-bot

Useful Links

API

Info

Problems

About

Telegram bot for sending predefined learning materials with some periodicity

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published