Skip to content

Latest commit

 

History

History
177 lines (99 loc) · 6.05 KB

File metadata and controls

177 lines (99 loc) · 6.05 KB

Contributing

Follow this guide if you wish to help with the development of this community project.

Purpose

The main goal of this project is to encourage our community members to participate in the development to learn something new, to contribute to the community, or just to getting started with open source.

This bot was kicked off to meet the needs of our community, but we thought on the long run that other communities may benefit from our project as well. We decided then to develop it in a more flexible way.

Any community on Discord could use a little help managing the day to day activities and delivering to its user the best possible experience.

There's a lot of bots available out there, but carelessly adding bots to gather all the features we like might be cumbersome and add too much overhead.

This project aims to reduce this overhead developing a bot for the community and with the community.

Get ready

To contribute to the code you'll need to:

  • Setup your local machine
  • Create for free a Discord developer account
  • Get a token for your development bot
  • Create a Discord server, for testing purposes
  • Invite the bot to your server

All of this will be explained step-by-step.

Local machine setup

If you made this far you most likely know the drill:

  1. Install the latest Node.js LTS (using nvm or similar library is highly recommended).

  2. Clone this repository

  3. Execute npm install

Discord developer account (free)

Here's a walkthrough to get up and running with Discord:

  1. Sign up or login to Discord Developer Portal, you can also use the QR code provided for logging in via mobile app. discord login

  2. In the dashboard, click New Application on the top right. discord dashboard

  3. Specify a name for your application (e.g. VanillaDev) and click Create. discord new app

  4. This is how your app overview looks like, do not share client secret under any circumstance. discord app overview

  5. Navigate to the Bot section, then click Add Bot. discord app add bot

  6. This is how your bot overview looks like, do not share token under any circumstance. discord app bot overview

For further information please refer to the official Discord documentation.

Getting your bot token

For local development you need to provide your bot token as follows:

  1. Open your browser.

  2. Navigate to your dashboard on Discord Developer Portal.

  3. Select the application you created.

  4. Navigate to the Bot section.

  5. Click Copy underneath TOKEN.
    discord bot copy token

  6. Open your IDE or editor of choice (e.g. Visual Studio Code).

  7. Open the folder where you cloned this repository.

  8. In the root folder, rename the file called .env-example to .env.

  9. Open the file .env.

  10. Paste the token you copied on PASTE_HERE_YOUR_TOKEN, be careful to leave no blank spaces.

Getting your user ID

  1. Open Discord client.

  2. Click on the ⚙️ icon in the bottom left.
    discord app cog icon

  3. Click on Appearance, then scroll down and enable Developer Mode.
    discord app developer mode

  4. Go to any server you joined and find your avatar on the user list on the right.

  5. Right click on your avatar, then click Copy ID to copy your user ID.
    discord app user id

  6. Open your IDE or editor of choice.

  7. Open the folder where you cloned this repository.

  8. Open the file .env.

  9. Paste the user ID you copied on PASTE_HERE_YOUR_OWNER_ID, be careful to leave no blank spaces.

Discord server creation

You need a Discord server to test your bot. To create one follow these steps:

  1. Open your Discord client.

  2. Click the + icon in the bottom left.

  3. Click the option Create My Own.
    discord create a server

  4. Customize your server adding a name and optionally an icon.
    discord customize your server

Bot invitation

A Discord bot is like a special user that needs to be invited to your server with a specific set of permissions, depending on the bot functionalities.

Here's a walkthrough:

  1. Open your browser.

  2. Navigate to your dashboard on Discord Developer Portal.

  3. Select the application you created.

  4. Navigate to the section OAuth2.

  5. Click Copy underneath CLIENT ID.

  6. Navigate to Discord Permissions Calculator, to facilitate this link has already been set with the correct permissions for this project.
    discord bot permissions

  7. Paste the Client ID you copied in the proper field.

  8. Click the link.

  9. In the new page you'll be prompted to login to Discord.

  10. Select via dropdown the server you want to add your bot to and click Continue.
    discord bot add to server

  11. You'll see a summary of the permissions, click Authorize.
    discord bot authorize

  12. Complete the reCaptcha to proceed.

  13. You'll be shown a success message.
    discord bot authorize success

Checking your server on Discord client your bot appears now as an offline user.

It's time to bring your bot online.

Bringing your bot online

To bring your bot online for development:

  1. Open a terminal.

  2. Navigate to the folder where you cloned this repository.

  3. Execute npm run dev.

Your bot appears now as an online user and you can interact with it.

Congratulations!