Note
-
🗂️ This repository contains the progress and code of the IE24.1401 Educational Innovation Project
-
🎯 Objective: Enable students to perform self-assessment activities in a more autonomous and approachable way, using gamification techniques. By incorporating elements of game design, such as rewards, challenges, and progress tracking, we aim to make self-assessment more engaging and enjoyable for students.
This README.md
is made for those who are not even familiar with Python
, so they can set up their bot by themselves.
Is needed to have Python
and the Telethon
module installed.
We can check if Python is installed and which version by running the following in the terminal/PowerShell:
python --version
If installed, it will return the version (it is recommended to use the same or a newer version):
Python 3.12.2
Caution
If not installed, go to https://www.python.org/downloads. This already include pip
since Python 3.4
.
We also need to install Telethon
module, we install that with pip
by entering in the terminal/PowerShell:
pip install telethon
We can check the instalation then by doing in the terminal/PowerShell:
pip list
This will return somethin like this in the terminal/PowerShell:
Package Version
-------- -------
pip 24.0
pyaes 1.6.1
pyasn1 0.5.1
rsa 4.9
Telethon 1.34.0
With this, we finishined using the terminal/PowerShell for now.
Note
This could be done by different programs as Visual Code, Visual Studio, Spyder, etc
We will use Visual Code
but others are also compatible with it.
Once opened, press Ctrl + Shift + P
.
In the search bar of Visual Code, a ">" will appear. With this, search for the action Git: Clone
.
It will ask for the repository name (or URL), enter it:
https://github.com/pedrorj2/Telegram-Gamification-UPM/
It will open the explorer to choose a local path to clone the repository.
After doing this, a tab will appear asking to open the repository; accept it.
Once the repository is cloned and opened with Visual Code, we need to fill in the identification data of our bot, which can be seen in the first commented lines. We need to fill them in and uncomment these lines.
# Configuración de tu API de Telegram
api_id = ' '
api_hash = ' '
bot_token = ' '
lista_profesores = []
Warning
You would see a import call like this in my code instead:
from config import api_id, api_hash, bot_token, lista_profesores
This makes possible to get this data from config.py
, file which is not uploaded to the repository, as indicated on the .gitignore
file.
lista_profesores
contains the user_ids of those who are granted access to restricted commands.
api_id
y api_hash
are obtained by creating a "Telegram Application" through https://my.telegram.org/apps.
bot_token
is obtained directly from the Telegram app via the @BotFather bot.
o do this, we need to create a bot, choose its name, and we will get this bot_token
to access the Telegram HTTP API.
With this, we can run our code, and our computer will host the bot's back-end. As long as it is running, our bot will respond to actions. However, if we close Visual Code, the bot will stop working until we restart it.
/rankingprofesor # Full user ranking with scores
/media # Average score and max score info
/lista # List of all registered users
/reset # Confirm and delete all user response data
/id # Display your Telegram sender ID