It is a bot designed to automate ticket availability tracking. It reads links from a Google Sheet, checks each link to see if tickets are available, and sends a notification to a designated Telegram channel when they are. The bot also includes an adjustable cooldown timer to prevent duplicate notifications within a specified period.
- Reads ticket URLs from a Google Sheet
- Checks each link for ticket availability
- Sends Telegram notifications when tickets become available
- Customizable notification cooldown period
Easily keep track of ticket availability with real-time alerts!
-
Generate Google service keys
-
Navigate to
https://console.cloud.google.com/and create a new project -
Select the newly created project from the project selection dropdown menu
-
On the
Enabled API and servicespage, click on the+ Enable APIS AND SERVICESbutton -
Now, search and enable the following services
- Google Sheets API
- Google Drive API
-
From the
Credentialsdrawer, click on the+ CREATE CREDENTIALSbutton and select theService accountoption. -
Now fill the required fields and hit
Create and Continuebutton. After that select a role. For simplicity, you can select the role ofowner -
Now, you will see a new account added under the
Service accounttab and then click on that new account. -
Now, go to the
KEYStab and click on theADD KEYbutton and selectCreate new keyoption. -
Finally, you will see a pop up of How you want to download the key. Select the JSON format and rename this to
sheet_reader_service_account.json
-
-
Generate Telegram Credentials
-
search for
BotFatherin Telegram -
write command
/start -
write command
/newbot -
give it a name
-
give it an unique username (ends with _bot)
-
copy the API token: For example 5401329997:AAF2ZHcsn93lj_qkqKGYyZRlNKC_isV_Vh8
[Not a valid key] -
Now create a channel/group in Telegram
-
Make the bot an admin of the channel
-
Send a hello message in the channel
-
Go to the url
https://api.telegram.org/bot{API_KEY}/getUpdatesto get the chat_id, for example -1002119021579
-
-
Clone the repository using the following command
git clone https://github.com/md-Salah/ticket-checking
-
Change the directory to
TicketTracker
-
Create and activate a virtual environment by running the following command
python -m venv venv .\venv\Scripts\activate
-
Run the following command to install the dependencies
pip install -r requirements.txt
-
Create a
.envfile in the source directory and place the below contentsTELEGRAM_BOT_API_KEY= TELEGRAM_CHAT_ID= -
Now, run the
main.pyfile to start the botpy main.py