/Discord-Whitelister-Bot

A Discord bot which allows users to enter their wallet address and be added to a CSV file.

Primary LanguagePython

Discord Whitelister Bot

This bot is designed to allow users to call a "/whitelist" command to privately enter and store their wallet address in a csv file, accessible by the bot host.

Setup & Installation

Setting up the bot

To create the bot which you intend to utilise the code, head to the Discord Developer Portal and create a new application. Set the desired Name, Image and Description.

image

Go to OAuth2->URL Generator setting and enable Bot in the upper section & Send messages in the lower section. This will generate a link at the bottom of the page, enter this into your browser and you'll receive a prompt to add the bot to your server.

image

Now that the bot is in your server, go to the Bot setting and generate a token. Save this as it will be used later on. (Do not share this token, as anyone who has access to it can control your bot.)

image

Hosting the bot

Head to Replit and create an account, then hit the + in the top right corner and create a new python bot (type "Python" in Template). Once created, create both "main.py" and "webserver.py" in the files section, and copy across the code from both relevant files in this repository. Your files should look like this:

image

On the left hand side, go to "Secrets" which is represented by a lock symbol. Create a new secret called "DISCORD_BOT_SECRET" and add the previously generated token.

image

Add a new file called "data.csv" and by default add "Username, Wallet address" as the first line. (NOTE: Current version requires 1 entry into the csv file to work). Once completed press "Run" at the top of the page, this will set up the bot and you should see the bot go from Offline to Online in your server.

Hosting the bot 24/7

To easily host your bot 24/7, create an account on UptimeRobot, once created add a new monitor using the "Add New Monitor" button in the top left of the page.

image

Select the Monitor type as "HTTP(s)" and then to get the URL, go back to your Replit application and copy the URL that it generates in the Webview tab. Once those are selected, press "Create Monitor" (There may be a popup about free/paid versions).

image

Future implementation

-allow users to edit their wallet address inside the csv file to reduce administration time.

-allow users to check their wallet address inside the csv file.