Prerequisites - TimmyRB/SydneyBot GitHub Wiki
Before you can start coding we need to get a few things out of the way
Notice
It is recommended to not run commands you're not developing as they may be server specific and could crash your bot when testing outside of the Sheridan SDNE Discord.
NodeJS & NPM
I recommend NodeJS v12.18.3 but any version after that from the NodeJS Website will work as well. Make sure to restart and command prompts you have open so that you can use node & npm from the command line.
You can check which NodeJS & npm version you have installed by running
node --version && npm --version
Git & Project Setup
- Download and install git onto your system
- Open a command prompt and navigate to your desired directory
- Run
git clone https://github.com/TimmyRB/SydneyBot.git && cd SydneyBot
- Next, run
npm i
in the new directory to download all required packages - Copy
example.env
to.env
by runningcopy example.env .env
Discord Application
- Create a new Application on the Discord Developer Portal
- Under where it says
Client ID
, click theCopy
button - On the left-hand side, click
Bot
and thenAdd Bot
- While not necessary, I recommend turning off the
Public Bot
option
- While not necessary, I recommend turning off the
- Make sure to turn on the
Presence Intent
andServer Members Intent
options - Open a new tab with this link and replace
YOUR_CLIENT_ID
with the Client ID you copied a few steps agohttps://discord.com/oauth2/authorize?client_id=YOUR_CLIENT_ID&scope=bot
- Once the bot is added to your server, go back to the Discord Developer Portal and copy your bot token
- Got into the
.env
we created and paste the bot token next toBOT_TOKEN=
- In Discord, open your User settings, go to
Appearance
then turn onDeveloper Mode
& close your Settings - Right-click the server you added your bot to into the server list, and click
Copy ID
- Paste the ID you just copied into your
.env
next toBOT_GUILD=
CockroachDB
- Create an Account or Login on CockroachCloud
- Click
Create Cluster
and choose the Free Tier - Once the
Connection info
popup appears, download yourcc-ca.crt
and save it toSydneyBot/certs/cc-ca.crt
- Next, copy the information under the
Your tool
tab and put it into your.env
DB_HOST=host
DB_PORT=port
DB_DATABASE=database
DB_USERNAME=username
DB_PASSWORD=password
Congrats! You're now ready to start developing! You can run the bot by running npm run start
in your command line.
Additional Tools
If you're looking for a way to manage your cluster and verify that everything is writing to the Database correctly, I recommend using Beekeeper Studio.
For Visual Studio Code users, I recommend using the following Extensions for ease of developing