A Discord bot made for ACM Cyber & Psi Beta Rho. :)
- Install Node and make sure corepack is enabled (
corepack enable). - Download and copy
.env.exampleas.env - Run
pnpm installto install dependencies - Either ask the infrastructure lead for your own discord bot user OR Create your own discord bot application: https://discordjs.guide/preparations/setting-up-a-bot-application.html
- Invite your discord bot to a testing discord server.
- Add the token from step 3 into the
.envin the proper location. Make sure there are no extra spaces between the text and the equals sign! - Replace DISCORD_CLIENT_ID with the OAuth Client id of your Discord application.
- Before making new changes, do
git checkout -b BRANCHNAMEwhereBRANCHNAMEis a name for whatever feature you are working on.
- As this bot uses a feature of GSuite (Google Drive), running this bot will require obtaining some credentials. You do NOT need a project with billing enabled to do this.
- Follow the instructions here (you can ignore the optional steps): https://cloud.google.com/iam/docs/service-accounts-create
- Once in the service account, go to keys --> add key --> create new key --> JSON, download and save this file as
credentials.json - Enable the API: Go to Google Workspace --> APIs, and enable the
Google DriveAPI. - To run the uploading photos feature of this bot, you must also designate a Google Drive folder for the bot to upload photos to. This can be done by creating a Drive folder, sharing it with the email of the service account, and setting the FOLDER_ID environment variable in
.envto the id of that folder (the section of the url after "folders/").
- Run
pnpm startto run the bot
- Do NOT run multiple copies of a bot under a single bot token, otherwise weird issues may occur!
- Make commits as needed.
git pull origin --rebaseto make sure your code is up-to-date. If this is unsuccessful, you may need to manually resolve conflicts by editing filespnpm fixto enforce coding formattinggit add . && git committhe prettier change if any files changedgit push origin BRANCHNAMEto push to remote branch of new name- Open Pull Request in Github website