This bot runs a constant stream of the @YRDSB Twitter page using the Twitter API and the Tweepy module and uses Discord Webhooks to post on a server. This project is fully open sourced.
This bot will need to run 24/7 on a system with Python 3 or higher. See deployment for notes on how to deploy the project on a live system.
What things you need to install the software and how to install them.
You will need to apply for a Twitter Developers API key to get the Consumer Key, Consumer Secret, Access Token and the Access Token Secret. You can do that here.
Tweepy - For accessing Twitter API (pip install tweepy)
JSON - For reading API responses (default)
dhooks - For forwarding content via Embed to Discord (pip install dhooks)
A step by step series of examples that tell you how to get this bot running on your system.
Open the yrdsbbot.py file and fill the empty variables with your Twitter Developer authentications.
Open Discord and choose a channel where you want these messages to be posted. Click settings and create a new Webhook. Name the webhook, give it a profile picture and copy the URL and add it to the webhooks list on yrdsbbot.py.
Get the Twitter User ID of the user you want to track. In this case, YRDSB's Twitter ID is 593188821. To find this User ID, click here
Save all changes and run the bot via a command-line program on your operating system. (For example, py yrdsbbot.py and the bot should print Discord Webhook Bot is online! when its ready)
- Twitter - Popular Social Media Platform
- Tweepy - Python module to access the Twitter API
- dhooks - Used to send embed data to Discord via Webhooks
- Shubham Shah - Full development - SpikePlayz
- Hat tip to anyone whose code was used. Thx <3
- Inspiration (There's nothing like this available and the YRDSB website needs an upgrade)