How to contribute

Since this guide is made specifically for the discord.js community, we want to be sure to provide the most relevant and up-to-date content. We will, of course, make additions to the current pages and add new ones as we see fit, but fulfilling requests is how we know we're providing content you all want the most.

Requests may be as simple as "add an example to the frequently asked questions page", or as elaborate as "add a page regarding sharding". We'll do our best to fulfill all requests, as long as they're reasonable.

To make a request, simply head over to the repository's issue tracker and create a new issue! Title it appropriately, and let us know exactly what you mean inside the issue description. Make sure that you've looked around the site before making a request; what you want to request might already exist!

Remember that you can always fork the repository and make a pull request if you want to add anything to the guide yourself!

Tip

We'll also get into some of the more advanced features this guide does below.

Components

Throughout the guide, you'll see some components from the @discordjs/ui package:

  • Alert
  • Section
  • DiscordMessages, DiscordMessage, and DiscordMessageEmbed

Check the source of this page to see them in action!

Alert

This component may take a title and a type of 'danger' | 'info' | 'success' | 'warning'.

This uses title="Alert" type="info":

Use these appropriately!

Alert

Section

DiscordMessages, DiscordMessage, and DiscordMessageEmbed

Guide Bot's avatar

Guide BotBOTToday at 21:00

A DiscordMessage must be within DiscordMessages.

Guide Bot's avatar
BOT
Guide Bot
A _`DiscordMessage`_ must be within _`DiscordMessages`_.
Guide Bot's avatar

Guide BotBOTToday at 21:01

It's much better to see the source code of this page to replicate and learn!

Guide Bot's avatar

Guide BotBOTToday at 21:02

This message depicts the use of embeds.

Guide Bot's avatarGuide Bot
An amazing title

This is a description. You can put a description here. It must be descriptive!

Sometimes, titles just have to be.
Guide Bot's avatarGuide Bot
Another amazing title

Multiple embeds!

When one amazing title just wasn't enough.
Guide Bot's avatar
BOT
Guide Bot
used
/interaction
Guide Bot's avatar

Guide BotBOTToday at 21:03

Interactions are supported! I definitely used a command.

Code blocks

We use Code Hike. Here are some example code blocks, which should be easy to grasp and learn upon reading the source code of this page:


_10
const HELLO = 'hello' as const;
_10
console.log(HELLO);
_10
// "ts" is the language of the code block.

fileName
anotherFileName

_10
const FILE_NAME = 'fileName' as const;
_10
if (FILE_NAME.includes(' ')) throw new Error('Spaces cannot be used in file names.');

requiredName

_10
const FILE_NAME_3 = 'requiredName' as const;
_10
if (!FILE_NAME) throw new Error('There must be a file name to use panels!');
_10
// The --- divider was used to create a panel.

For more information, be sure to check out the documentation.