Dis be a TS rewrite still in progress. Look into TODO.md
FurDevs Discord Bot is a Multipurpose Discord Bot for the FurDevs Discord Server
This section is for you if you're already familiar with discord bots in general.
To use the FurDevs Discord Bot on your server, you'll need:
- Git, NPM or Yarn, and Node.js
- A Discord account
- MongoDB Account, and a database for FurDevs
- An application for the bot (Make this in the Discord Developer Portal)
- Common Sense ( Don't leak the bot token )
Once you have all the dependencies:
git clone https://github.com/Discord-FurDevs/FurDevs-Bot.git
- Run
npm install
. - You'll find a
.env.example
, Rename it to.env
then add all of the neccessary information. - Start the bot by doing
node .
.
If you're not terribly familiar with discord bot development, then this section may be for you. It has a little more detail than the above section, and focuses on getting things working in Windows 10.
Of course, if you'd like help, head on over to the FurDevs Discord server. :)
Discord bots are programs that run on internet connected computers. They talk to the Discord API to do things like send messages in a Discord server.
To add the FurDevs Discord Bot to a server, you'll have to:
- Have a Discord account.
- Have a Discord server you want to add it to. (You have to have the proper permissions to do this. If you're just testing out the bot, then you should probably make an empty one for testing purposes.)
- Have a copy of the FurDevs Discord Bot running on your computer.
To run the FurDevs Discord Bot on your computer, you'll need to install the following if they're not on your Windows 10 system already. Some have lots of options in the installation process - just accept all the defaults and click next until the installation is complete and you should be fine.
When you install MongoDB Community with the defaults, a MongoDB service is installed on your Windows 10 installation. When you're done using MongoDB for this bot (or other purposes) it makes sense to disable it. To do that, type "services.msc" in the start menu, press enter, scroll down to and click "MongoDB Server", click the "Stop" button, then change the "Startup type" to "Disabled".
You'll also install MongoDB Compass. This is just a tool for looking at what's stored in your instance of MongoDB. You don't have to use this to run the FurDevs Discord Bot, but it's nice to have around in case you want to see what's stored in the database. All you have to do to use it is connect to the database by putting the following in the connect box and the pressing the connect button:
mongodb://127.0.0.1:27017
Now that you have the prerequisites installed, let's get a copy of the bot.
In a folder that you'd like the bot to be stored in, right click and select the "Git Bash Here" option. Then run the following: (leave it open, we'll use it for subsequent steps)
git clone https://github.com/Discord-FurDevs/FurDevs-Bot.git
You should see that a new folder was created falled "FurDevs-Bot". Now we enter that folder like this:
cd FurDevs-Bot
Before we can run the bot, we have to configure it.
The first part of that is installing the bot's JavaScript dependencies. In the same "Git Bash" window you left open from before, run the following:
cd FurDevs-Bot
npm install
After a few seconds, the dependencies should be installed.
Once that's done, we can configure the bot's .env
file.
The .env
file contains three settings that are specific to everybody's individual running copy of the bot, so we have to configure them each time we create a new instance of the bot.
TOKEN=
DB=
DICTIONARYAPI=
There's an example file that includes the above that you can fill out to be your .env
file. Just run:
cp .env.example .env
Then open the .env
file in notepad with:
notepad .env
The TOKEN is the identifier that we get from Discord to identify our instance of the bot. With it, Discord can differentiate between different instances of the same bot. We have to get one generated to use for our instance. We also have to be careful to protect it, as sharing it would allow others to impersonate our bot. (If you've ever used another API before, it's basically your "API Key")
To generate an Application Token (as they're technically called) we have to log into the Discord Developer Portal and perform the following steps:
- Click the "New Application" button in the top right of the page.
- Give the application a name. "FurDevs Bot" makes sense here, but you can call it whatever you'd like.
- Go to the "Bot" section in the menu on the left hand side of the page.
- Click the "Add Bot" on the right hand side of the page.
- Confirm that you'd like to add the bot.
- Underneath the Bot's username and to the right of the Bot's icon is a link that says "Click to Reveal Token". Click it and copy it into your
.env
file afterTOKEN=
!
Once your token's created, we should give it some permissions while were in the right page of the Discord Developer Portal
- Go to the "OAuth2" section in the menu on the left hand side of the page.
- Check the "Bot" box in the middle column of boxes to check.
- In the checkboxes that appear below, check the "Administrator" box under the "General Permissions" column. (Warning: This is fine for a test server, but you should read about Discord Bot permissions before checking the Administrator box for a bot that has actual users.)
- Copy the URL generated under the first group of checkboxes.
- Paste the URL into your browser.
- Select the server you want to add the bot to.
- Click "Continue" then "Authorize".
You're done configuring the token!
The DB tells the bot where it can find a MongoDB database that it can use to store its data.
This one is easy to configure - you just have to tell the bot to use your local instance of MongoDB by using the following value:
mongodb://127.0.0.1:27017
The DICTIONARYAPI setting is for a Merriam-Webster Dictionary API key. With it, the FurDevs discord bot can look up words in the Merriam-Webster dictionary. This is optional, so for now, we'll skip it. However, if you want to get an API key, you can do that here: https://dictionaryapi.com/
Once your .env
file is configured, save and close it, the return to your Git Bash window and run the following to start the bot:
node .
Also, it might be scary at first if you see a bunch of text flood down your terminal! Don't worry, this is completely normal. It's the bot's debugging output telling you what is happening.
That's it! You're done! Play around with the bot by using it's commands in your server; >help
and >furryirl
, for example!