- #DISCORD RAID ALERT BOT HOW TO#
- #DISCORD RAID ALERT BOT INSTALL#
- #DISCORD RAID ALERT BOT UPGRADE#
- #DISCORD RAID ALERT BOT FULL#
env file within the same directory as your program, as well as its parent directories. Environmental VariablesĬalling load_dotenv() will look for a. On top of the discord module, we’re going to use something that we could have implemented earlier with the email details environmental variables. The Python Discord API Wrapper documentation includes installation instructions for a few different configurations if you need help.
#DISCORD RAID ALERT BOT INSTALL#
So, we’ll need to install and then import it.
#DISCORD RAID ALERT BOT UPGRADE#
Additional Imports to Upgrade Your Scraper Into a Discord Bot for Availability AlertsĪs you’ve likely already guessed, interacting with the Discord API isn’t a default feature of Python. Now, let’s discuss the extra goodies we’ll be using. Again, make sure you give the role to yourself, as I’m assuming that’s the whole reason you’re making this bot. I’ll refer to it as the alert role “Tracking PS5 Alerts” in the code. The other role is for people that will get pinged when the bot detects that PS5s are available. Once the role is created, be sure to give the role to yourself, the bot is going to check for it. I’ll refer to it as the authorized role “Bot Boss” in the code. The first role is for people that are allowed to command the bot to manually run a scraping attempt. You want to create two roles via Server Settings > Roles. In addition to all of this setup, there’s one more thing you want to do inside the server the bot will run in. Use the generated URL to invite the bot to the server and Authorize it.Select Bot under Scopes and Administrator under Bot Permissions.Go back to the Applications Page and go to your bot’s page.Copy the token and keep it to the side for now.Then go to the Applications page and create a New Application.
#DISCORD RAID ALERT BOT HOW TO#
The documentation for the Discord Python API wrapper covers how to create a bot account in depth with images. Once you have your server ready, you’ll need to make a bot account to get a unique token password for your bot. Because of this fact, I recommend making a new server specifically for the bot’s purposes. However, most people won’t casually grant them to a random bot.
#DISCORD RAID ALERT BOT FULL#
Also, to simplify things, the code will assume that the bot has full rights. You’ll need admin rights in every server that you want to invite the bot to. Or, you can make a separate account for it if you really want. You can use your normal account to set the bot up. Presumably, you have some degree of familiarity with Discord already, hence why you’re compelled to make a Discord bot. But, it is a good habit to have.Īlso, in order for the bot to play nice with Discord, you’ll need to actually use Discord. This step isn’t necessary if you’re never going to show your code to anyone else. One of them involves making an external file for private variables, rather than including it in the code. There are some more libraries you’ll need to install and import to expand the web scraper we’ve made so far. What You’ll Need to Upgrade Your Scraper Into a Discord Bot for Availability Alerts In the spirit of keeping things beginner friendly, we’re coding in Python with an easy-to-use free library for web scraping uniquely named BeautifulSoup. Now let’s upgrade that basic web scraper into a Discord bot for availability alerts. We’ve gone over how to write your own PS5 availability tracker, as well as how to have it send out email notifications. So far we’ve covered a few steps on increasing your chances of getting a PS5 at retail price.