Display real-time campus data in HKUST FYS Discord server.
For Colab development Open the source code for the Bot here
For Discord Bot production Clone this repository:
git clone https://github.com/hkust-fys/hkust-data-dashboard.git
- For Colab development Copy the whole script to a code cell on Google Colab.
For Discord Bot production Set up virtual environment for the bot:
cd ~/hkust-data-dashboard
python -m venv ./.venv
- Run the script once for setting up dependencies and the
.env
file. This message will be printed to the console:
Dependencies and .env file set up. Please edit the .env file with valid input.
These packages will be installed or updated:
For Colab development Create a webhook in your debug channel and copy its Webhook URL.
Here is a tutorial on how to create a webhook on Discord.
For Discord Bot production Create a bot user in the Discord Developer Portal and copy its token.
Here is a tutorial on how to create a bot on Discord.
- Edit the
.env
in the bot's directory:
BUS_QUEUE_KEY
,SSC_KEY
,PPL_COUNT_KEY
are all from HKUST. Ask us to lend you our token.DEV_WEBHOOK
is for Google Colab development purposes. Edit it to a valid Discord webhook URL or comment it out for Discord Bot production.DISCORD_TOKEN
andANNOUNCE_CHANNEL_ID
will only be read ifDEV_WEBHOOK
is commented out.DISCORD_TOKEN
is the Discord Bot token.ANNOUNCE_CHANNEL_ID
is the ID of the channel to display the data in.
Find your user and server IDs here.
For Colab development Ctrl+Enter anywhere in the code cell you use will run the entire script.
For Discord Bot production
Run bot.py
python3 bot.py