+
Skip to content

ktm19/cyber-discord-bot

 
 

Repository files navigation

cyber-discord-bot

A Discord bot made for ACM Cyber & Psi Beta Rho. :)

Setup

  1. Install Node and make sure corepack is enabled (corepack enable).
  2. Download and copy .env.example as .env
  3. Run pnpm install to install dependencies
  4. Either ask me (Alec or Andrew) for your own discord bot user OR Create your own discord bot application: https://discordjs.guide/preparations/setting-up-a-bot-application.html
  5. Invite your discord bot to a testing discord server.
  6. Add the token from step 3 into the .env in the proper location. Make sure there are no extra spaces between the text and the equals sign!
  7. Replace DISCORD_CLIENT_ID with the OAuth Client id of your Discord application.
  8. Before making new changes, do git checkout -b BRANCHNAME where BRANCHNAME is a name for whatever feature you are working on.

Google Service Account credentials

  • 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.
  1. Follow the instructions here (you can ignore the optional steps): https://cloud.google.com/iam/docs/service-accounts-create
  2. Once in the service account, go to keys --> add key --> create new key --> JSON, download and save this file as credentials.json
  3. Enable the API: Go to Google Workspace --> APIs, and enable the Google Drive API.
  4. To run 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 replacing the "[FOLDER ID]" in uploadphotos.js with the id of that folder (the section of the url after "folders/").

Running

  1. Run pnpm start to run the bot
  • Do NOT run multiple copies of a bot under a single bot token, otherwise weird issues may occur!

Getting ready to push/Making Pull Request

  1. Make commits as needed.
  2. git pull origin --rebase to make sure your code is up-to-date. If this is unsuccessful, you may need to manually resolve conflicts by editing files
  3. pnpm fix to enforce coding formatting
  4. git add . && git commit the prettier change if any files changed
  5. git push origin BRANCHNAME to push to remote branch of new name
  6. Open Pull Request in Github website

About

A Discord bot made for Psi Beta Rho. :)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 95.2%
  • Dockerfile 4.8%
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载