Server Anti-Raid, developed by ACPlayGames! Small moderation bot made for fun.
NOTE: This is not recommended for beginners. Please learn the basics of Python before attempting to use this code!
This is a basic moderation bot that you can add on to to suit your own needs. Feel free to contribute anything you want here. The best way to prevent raids is to enable two-factor authentication on your account and guild, adding a stricter verification level, enabling explicit content filter, and to give out administrative permissions with caution.
A tutorial and explanation regarding how to use the bot is on my YouTube!
Join the official Discord server!
To get started, a few things must be installed.
-
Download Python. Please make sure to check the "Add Python to PATH" option!
-
We will be installing discord.py for this project. Open Command Prompt on your computer and type in
pip install discord
. -
Clone the GitHub repository (either using the web URL, GitHub Desktop, or downloading the zipped file).
-
To create a bot, go to the Discord Developer Portal and press
New Application
. -
Name your application whatever you want, then hit
Create
. You can also set an optional description here. -
On the left side, press the
Bot
tab, then pressAdd Bot
, thenYes, do it!
. This will transform your application into a bot. -
Scroll down, and under
Privileged Gateway Intents
, check theServer Members Intents
option. -
Once your bot has appeared, copy your bot token by pressing
Copy
. You will use this later. This is how your program will login to your bot. It is very important to keep this token safe, as it is your bot account credentials! -
Now, go to the left side and go to the
OAuth2
tab. Under theScopes
options, checkbot
. A section titledBot Permissions
will appear below. You will select your bot permissions here. We will using theAdministrator
permission, so please check that option. Now, under Scopes, you will see a link which you can invite your bot with. Copy this link and open it to invite your bot.
With those steps done, you are almost ready to go! However, please note that in main.py
, the second to last line is shown below.
bot.run('TOKEN HERE')
Please replace the TOKEN HERE
text with your bot token from earlier, as shown below.
bot.run('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890')