DEV Community

Cover image for StudyHelper - my new pet project(Telegram bot)
Maksym Zavalniuk
Maksym Zavalniuk

Posted on

StudyHelper - my new pet project(Telegram bot)

Preface

Hello everyone!πŸ™‚
This is my new Telegram bot and I want to share this project with you. You can get all the available code here.

The idea of the bot is to make the learning process easier. Teachers create subjects and tasks, invite students, grade them, and get statistics. Students receive a list of tasks that are closest to the due date, create solutions, and upload them.

Since this is a pet project, you won't see any grandiose things here. Mostly, I wanted to get acquainted with new technologies, such as Tortoise and AWS.
You can see the most interesting solutions and features of the bot below⬇️

Features

Teachers

The main thing that a teacher can do is create subjects, invite students to them, and interact with them.

Teacher intro

As you can see, all the functionality here is done not through buttons, but through links. These are deep links. That is, in the chat, you will see something like β€œ/start”, but in reality, it will be β€œhttps://t.me/testmezgoodlebot?start=eyJrZXkiOiAic2VlX3Rhc2tzIiwgImlkIjogNH0”. And this code will process it. I made it so that it launches some methods from utils using this method. And accordingly, it was enough for me to create a method, pass the name, and it's done. Very convenient.
So, if we continue, teachers can look at the assignments for the subject like this:
Subject tasks
and statistics, for example, how many solutions from students there are in percentage value and the histogram of grades through the subject.
Subject statistics

When we open solutions to tasks, we can evaluate them through the buttons, and the message will be updated on the spot. There will also be a link to the work file. All data is stored on AWS S3.

Solution overview

The entire logic of interaction with AWS S3 can be found here. It is the same for both students and teachers.

Students

This is what the start of work looks like for a student (I've already skipped the process of joining the course).

Student start

That's how I created a new solution. At first, I wanted to add it to the task, but the deadline had already passed. Since I am both a teacher and a student, I received a notification that the student had uploaded the solution.

Upload solution

On AWS, the bucket looks like this: subfolders for subjects and students, and then the file itself is created here.

AWS S3 1

AWS S3 2

Students can also use the feedback function with the teacher (code here). All of this is built on states.

Conversation example

Noteworthy

I may not have shown the most important features, but I will provide a list of what might be of interest:

  • Using a filter that, in addition to passing to the handler, also returns the value of the object from the database.
  • Using the magic filter F.
  • Creating charts with seaborn.
  • Using ORM Tortoise.
  • Pushing objects to handlers using middlewares.
  • Send notifications on a schedule.

Conclusion

I hope you enjoyed my pet project and learned something new. Write your impressions and questions in the comments. By the way, soon in the future, I want to launch my course, where I will go through all the topics of developing Telegram bots, as well as using artificial intelligence.

Top comments (0)