Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Latest commit

 

History

History
85 lines (55 loc) · 4.13 KB

CONTRIBUTING.md

File metadata and controls

85 lines (55 loc) · 4.13 KB

How to Contribute to Codecademy Community Bot

All input is welcomed! Below are some of the basic steps to contribute to this project. Please read all of it to make sure you stay consistent with everybody else.

Please review the Issues tab and self-assign or ask to be assigned to one if you want to try to help in those. This keeps the efforts tidy and we know who is working on what.

Initial Setup

If you don't have it already, install/setup Git on your machine.

Fork/Clone This Repo

If you are a member of our organization, skip step 1.

  1. In the top-right corner of the page, click the Fork button.
  2. In the main page of the repo, notice the big green button that says "Code". Click it.
  3. Using the HTTPS or SSH option, copy the URL.
  4. If you are using HTTPS, using Git Bash/Terminal/Bash, navigate to the folder where you want this repo to be located in your machine and use:
$ git clone pasteURLYouJustCopied
  1. If you are using SSH, follow this GitHub tutorial.

If you become a regular contributor, we will add you to the organization so you can work off a direct clone instead.

Node.js and npm

  1. Install Node.js; it can be downloaded from here. This project requires version 16.x or higher.
  2. On the command line, navigate to the cloned repo.
  3. Use the following command to install all necessary packages:
$ npm install

Add Secret Keys

  1. In the cloned repo, create a file named .env. This will store environment variables you may want to keep secret.
  2. Create variables named BOT_TOKEN, GUILD_ID, and CLIENT_ID (you will assign these values later on).

Create a Discord Application and Bot

  1. Head to the Applications section of the Discord Developer Portal and create a new application.
  2. Navigate to the Bot section and click "Add Bot". You can add an icon and name for your bot.
  3. Copy the bot token and paste it into the BOT_TOKEN field in your .env file.
  4. Navigate to the OAuth2 section, copy the Client ID, and paste it into the CLIENT_ID field in your .env file.
  5. Check the bot and applications.commands checkboxes under Scopes, and grant your bot the desired permissions under Bot Permissions.
  6. Copy the URL under Scopes, paste it into your browser, and add your bot into your desired server.
  7. You should now be able to see the bot in your server (it will appear Offline).
  8. Right-click on the server name in the top-left corner, click Copy ID, and paste it into the GUILD_ID field in your .env file. If you do not see the option to Copy ID, head to your User Settings and turn on Developer Mode.

Run the Bot

  1. Navigate to your local repo and enter the following command into your terminal. This command must be run every time a command is added or updated, but not for non-command changes.
$ npm run deploy-commands
  1. Next, start up the bot using the following command in your terminal:
$ npm start
  1. Your bot should now appear Online in your server.

Advanced Setup (optional)

This has yet to be added to this project. For information about our pre-commit hook and setting up your local environment to use ESLint, Prettier and Git Blame, check out the Advanced Setup page of our moderation bot wiki.

Repository Git Workflow

We use a typical Git branching workflow. If you are new to Git and GitHub, visit our Git Workflow wiki page on our moderation bot repo for a quick-start guide!

Report Issues

Please use Github's Issues. Report a bug or request a feature there. Please do:

  • Use an appropriate label for the issue. If you think the current labels don't apply, create a new one
  • Don't forget to add your issue to the project Kanban board
  • If it is a bug: describe the bug and how to reproduce it
  • If it is a feature request: explain the idea, how you think it could be done and what need it is addressing