Skip to content

hkust-fys/hkust-data-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

hkust-data-dashboard

Display real-time campus data in HKUST FYS Discord server.

Usage

🌐 Download the bot

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
  1. 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
  1. 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:

🪪 Get an account for the bot

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.

  1. 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 and ANNOUNCE_CHANNEL_ID will only be read if DEV_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.

Run the bot

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

🏁 And you're all set!

About

Display real-time campus data in HKUST FYS Discord server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages