Before running the bot, make sure you meet the following requirements:
Python es necesario para ejecutar este programa. Para verificar si lo tienes:
-
Open the terminal:
- Windows: Press
Win + R, writecmdand press Enter. - macOS/Linux: Search "Terminal" in your sistem and open it.
- Windows: Press
-
Type the following command and press Enter:
python --versionIf it does not work:
python3 --version- If you see something like
Python 3.x.x, it is already installed. - If it does not appear, download it from python.org and install it. Important: Check the Add Python to PATH option during the installation.
- If you see something like
The bot file is called GolBot.py. Make sure you have it on your computer and know in which folder it is located.
- Windows: Open
cmdor PowerShell (Win + R, typecmdand press Enter).. - macOS/Linux: Open the “Terminal” application.
To run the bot, you first need to be in the folder where you saved GolBot.py. Use the cd command to move around:
- If you saved the file to your Documents folder:
-
In macOS/Linux:
cd ~/Documents -
In Windows:
cd C:\User\YourUser\Documents
-
To make sure the file is in that folder, type:
ls # macOS/Linux
dir # Windows
You should see GolBot.py in the list of files.
The bot is run with Python. To start the bot, use one of the following commands, depending on how your system is configured:
-
If your sistem uses
python:python GolBot.py -
If your sistem uses
python3:python3 GolBot.py
The bot will start working and you will be able to interact with it through Telegram.
The /start command welcomes the user and displays the available options:
- It offers commands to view today's matches, the complete matchday, the standings and the top scorers. para consultar.
- Ofrece comandos para ver los partidos de hoy, la jornada completa, la clasificación y los máximos goleadores.
The /partidos command allows the user to obtain information about the matches of a league on a specific date. You must use the command as follows:
-
Matchs of today:
/partidos <league> hoy -
Matchs of the matchday:
/partidos <league> jornada
If you do not specify the league or mode correctly (today/day), the bot will prompt you to do it correctly.
The /clasificacion command allows you to look up the current standings of a league. You must use the command as follows:
/clasificacion <league>
This command returns a list of ranked teams and their points.
The /maximos command displays the top scorers of a league. You must use the command as follows:
/maximos <league>
This command returns a list of the players with the most goals in the selected league.
- If the league or the parameter (hoy/jornada) is omitted in the commands, the bot will prompt you to include it.
- If the league is not valid, the bot will report that the selected league does not exist.
- If the bot cannot get the data from the Football-Data.org API, it will show you an error message.
requests: Used to make HTTP requests to the Football-Data.org API.telebot: Library to interact with the Telegram API and create the bot.- datetime
andpytz`: To handle dates and times, setting the time zone to Madrid (Europe/Madrid).
start(): Sends a welcome message with the bot options when it starts.obtener_partidos(): Gets the matches of the specified league (today or matchday).obtener_clasificacion(): Gets the rankings of the selected league.obtener_maximos(): Shows the top scorers of the selected league.formatear_partido(): Formats the information of each match to present it clearly.
This bot uses the Football-Data.org API, which has a request limit. Make sure not to make too many requests in a short period of time to avoid crashes. Also, the API may be temporarily unavailable, in which case the bot will not be able to get the data.
⚠️ ¡Important! The bot only works running the python file, if you don't run the bot doesn't work.
When using /start the following message will be displayed:
When using /partidos, followed by the desired league and hoy (today) or jornada (matchday) the following message will be displayed (taking into account that if the match has already finished it will show the result and if it is in game it will show 🟢 En juego (In game)):
When using /maximos the following message will be displayed with the top scorers of the selected league:
When using /clasificacion the following message will be displayed with the classification of the selected league:
- Open Telegram and search for @BotFather.
- Start a conversation and use the command:
/newbot
- Choose a name for your bot (it can be anything).
- Then choose a unique username for the bot (it must end in bot, for example: GolazoBot).
- BotFather will give you an access token like this:
123456789:ABCdefGhIjKlmNoPQRstuVWxyZ
- Copy that token and paste it into your code as above.
⚠️ Keep your token private! Anyone with access to it can control your bot.
- Go to https://www.football-data.org/.
- Click on “Get your free API key” or “Sign Up” at the top.
- Sign up with your email address.
- Once registered, go to the Dashboard.
- There you will see your X-Auth-Token, which you will need to include in the code as API_KEY.



