Study Bot is a Discord bot that will help students find partners to study with. Students will be able to find other students looking for people to work with, then have a Discord channel created for them to work together.
First, we'll need to create a Discord bot and get a token for it. For this, we can follow the Discord.js guide found here.
Next, we'll need to invite the bot to our server. For this, we can follow the guide on the Discord.js website found here
Next, we'll need to set up the config.json
file. In the terminal, run the
following commands:
cp example.config.json config.json
This created a copy of the example.config.json
file. Now, we can open
config.json
in VS Code and replace the fields there with our values.
{
"token": "",
"clientId": "",
"guildId": ""
}
There are three fields in the config.json
file.
- The
token
field is the token from the Discord bot. - The
clientId
field is the client ID from the Discord bot. This can be found by right-clicking on the bot, and clicking "Copy ID". - The
guildId
field is the ID of the server that the bot is in. This can be found by right-clicking on the server, and clicking "Copy ID".
Now, we can run the bot. In the terminal, run the following command:
npm install
This will install all of the dependencies for the bot. Next, we'll need to deploy the slash commands to the server. In the terminal, run the following:
npm run deploy
Now, we can run the bot:
npm run start
Try the ping tommand to make sure it works. Then, change the ping command to instead reply "Hello world!".
Read the docs here and try some things out.