Discord bot written in python. Used for the r/Oilpen discord but can be used by others by modifying the settings.json file to fit your needs.
PMs user on join with whatever message you set and a unique code, user must enter the unique code into a specified channel and they receive a discord role. Used to verify new users have read our rules and prove they are a human.
You will need the Server Members privileged intent for this bot to work, enable it in the discord dev portal under "Privileged Gateway Intents"
We run ours in docker , but for most people it would be easier just running the code on your console. I am not an expert on docker, their could be an eaiser way to do this that I do not know about, feel free to submit a PR and I will change it.
- Fork the repository
- Open settings.json in your editor of choice and change the contents of "one", "two", and "three" to fit your needs
- Clone the repository onto the machine you will be running the bot on
git clone https://github.com/YOURGITHUBUSERNAME/Discord-Gatekeeper/
- Install python requirements
pip3 install -r requirements.txt
- Edit settings.json and replace Token, Role, and Channel with your values. Role is the role it gives the user and channel is the channel it looks in for the commands to be put in. To find these ids turn on dev mode in discord and then right click the channel and role and click copy ID
- Run the following command to run the bot
python3 bot.py
- To make it run in the background use screen , and create a startup script in your distros preferred method.
- Do Steps 1 and 2 from above.
- Create a new repo on Docker Hub
- Name it discordgatekeeper
- Connect it to Github and select your Discord Gatekeeper repo on github
- Click Create and Build
- Take note of the text next to the globe. That is your dockerhub username and the repo name on dockerhub you will need this later
- On your docker host, run the following command
docker run -d \
--name=DiscordGatekeeper \
-e TOKEN='DISCORDBOTTOKEN' \
-e ROLE='ROLEID' \
-e CHANNEL='CHANNELID' \
--restart unless-stopped \
YOURDOCKERHUBACCOUNTNAME/discordgatekeeper
- If you want to verify its working, just check the logs for the container
Initial code from sourovafrin on Fivrr
Assits from discord members on r/Oilpen