Discord bot for the Gender and Sexuality Alliance.
Important
To see a full list of features, see List of all Features
Use this link if the first one is broken (GitHub struggles with relative links on the main page)
- Ensure all dependencies are configured and running
- Clone the repository
- If installing from github, use
git clone https://github.com/ClaireWhere/gsabot.git
- If installing from github, use
- Configure the Environmental Variables
- Run
npm init -y
to initialize the package - Run
npm run initialize
to deploy any commands to the Discord bot. This only needs to be run whenever new commands are added to the application. - Run
npm run dev
to start the application
- Node js
sudo apt install nodejs
- ensure it is properly installed and working with
node -v
- Node Package Manager (npm)
sudo apt install npm
- ensure it is properly installed and working with
npm -v
Note
The following dependencies are only required for the deleted message
features (see FEATURES). If these features are not being utilized, disable them in client/config.json.
- SQLite
- This application uses a local SQLite deployment.
- Download
- Detailed Installation instructions
- A Publicly routable IP address
-
server.js
is configured to run on the local port specified in theAPP_PORT
environmental variable and assumes subdomain.domain specified inSERVER_SUBDOMAIN
andDOMAIN
environmental variables routes to the network the application is running on and to that port locally. -
Since this is a local port, there must be a way for the router to route traffic to the specific port on the network the application is running.
-
One easy way to do this without exposing the network IP is to setup a Cloudflare Access Tunnel. More information can be found at https://www.cloudflare.com/
-
Note
(Optional) To use the latest release/update from github, the following dependencies are required
- Git
sudo apt install git
- ensure it is properly installed and working with
git --version
- Add a username with
git config --global user.name "your-username"
- Add an email address with
git config --global user.email "example@email.com"
To be added
Ensure all environmental variables are spelled exactly as below and can be found in .env
in the root
(.env) and /client
(client/.env) directory before running the application.
APP_PORT
- the local port the server application should be running onDOMAIN
- the domain name of the application- does not include any subdomains (www)
SERVER_SUBDOMAIN
- the subdomain used for the server application
CLIENT_ID
- the Client ID of the Discord bot applicationGUILD_ID
- the ID of the Discord server the bot should be inDISCORD_TOKEN
- the token secret for the Discord bot applicationSCHOOL
- the name of the school this bot is for, formatted for displaySCHOOL_CODE
- the abbreviation of the school this bot is forREGISTER
- the name of the registration service for the bot- as in, "go to REGISTER to register for this organization"
GSA_BANNER
- the banner image- Since the
gsa banner
image may contain sensitive information about the name of the school, it is contained in client/.env. All other images are in client/config.json since they shouldn't contain any sensitive information.
- Since the
DOMAIN
- the domain name of the application- does not include any subdomains (www)
MINECRAFT_SUBDOMAIN
- the subdomain used to connect to the Minecraft server
Button id's follow the format: category
:subcategory
:id
Note
id
is always the last element of the group and is the most specific descriptor of the purpose of the button. category
and subcategory
are both optional to add additional description to the purpose. This is especially helpful if there are many buttons that require similar response actions that can be filtered out with a single category
descriptor. subcategory
can similarly offer a second level of description. There is technically no limit to how many subcategories there are, but it is recommended to try to keep them as concise as possible while offering a balance between readable simplicity and code efficiency.
role
- specifies a role that should be applied or removed from the source user{id}
- the id of a role that has no subcategorypronouns
{id}
identity
{id}
year
{id}
color
no
- indicates the color interaction should be canceled{hex}
- the hex code representing a color. Should have the format xxxxxx, where x is [0-9] or [a-f] all lowercase
{id}
- the id of a specific action with no other similar buttons
Note
To add a new reaction role, simply specify its information in client/config.json in the roles
section. When a button is pressed with the same id as the id
property specified, that role will be handled by the bot. No other configuration is necessary. Just ensure the information in client/config.json lines up with the roles in the Discord server.
Adding new functionality must be specified in buttonEvent.js