Skip to content

Commit

Permalink
chore: commit suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: Souji <timoqueezle@gmail.com>
  • Loading branch information
Jiralite and almostSouji committed Dec 9, 2023
1 parent ab1c0bf commit f473e59
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apps/guide/src/content/01-home/03-how-to-contribute.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To make a request, simply head over to [the repository's issue tracker](https://
request](https://github.com/discordjs/discord.js/pulls) if you want to add anything to the guide yourself!
</Alert>

We'll also get into some of the more advanced features this guide does below. It is recommended to view the [source](https://github.com/discordjs/discord.js/blob/main/apps/guide/src/content/01-home/03-how-to-contribute.mdx) of this page to see how exactly they are to be used.
We'll also get into some of the more advanced features this guide uses below. We recommended you have a look at the [source](https://github.com/discordjs/discord.js/blob/main/apps/guide/src/content/01-home/03-how-to-contribute.mdx) of this page to see exactly how they work.

## Components

Expand Down
4 changes: 2 additions & 2 deletions apps/guide/src/content/02-getting-started/01-starting-out.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ bun create discord-bot

</CH.Code>

You'll be asked the directory to create the application in, as well as whether TypeScript should be used. Dependencies will be automatically installed for you. After this, you've just got your startup Discord bot template _nearly_ ready!
You'll be asked the directory to create the application in, as well as whether TypeScript should be used. Dependencies will automatically be installed for you. After this, you've just got your startup Discord bot template _nearly_ ready!

Next, we'll need to create an application so we are authenticated use Discord's API. This will be covered in the next section.
In the next section, we will explain how to create an application to interact with Discord's API.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ On the bot tab, you'll see a section like this:

In this panel, you can give your bot a snazzy avatar, set its username, and make it public or private. Your bot's token will be revealed when you press the "Reset Token" button and confirm. Once you've done this, copy it and paste it in the .env file after _`DISCORD_TOKEN=`_.

If you happen to lose your bot's token at some point, you will need to come back to this page and reset your bot's token which will reveal the new token, invalidating all old ones.
If you happen to lose this token at some point, you will need to come back to this page and reset it, which will reveal the new token, invalidating all old ones.

### Bot token explanation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ The structure of the URL is quite simple:

## Creating and using your invite link

To create an invite link, head back to your application in the [developer portal](https://discord.com/developers/applications), click on your bot application, and open the OAuth2 page.
To create an invite link, head back to the [developer portal](https://discord.com/developers/applications), click on your bot application, and open the OAuth2 page.

In the sidebar, you'll find the URL generator. Select the _`bot`_ and _`applications.commands`_ options. Once you select the _`bot`_ option, a list of permissions will appear, allowing you to configure the permissions your bot needs.

Grab the link via the "Copy" button and send it in a channel in Discord. CLick on the link you just sent which should reveal this:

![Bot Authorization page](/assets/bot-auth-page.png)

Choose the server you want to add it to and click "Authorize". Congratulations! You've successfully added your bot to your Discord server.
Choose the server you want to add the bot to and click "Authorize". Congratulations! You've successfully added your bot to your Discord server.

At this point, you should have a Discord bot via [create-discord-bot](https://github.com/discordjs/discord.js/tree/main/packages/create-discord-bot) with your .env file populated and your Discord bot in a server. You are now ready to do what you like.
At this point, you should have a Discord bot you created with [create-discord-bot](https://github.com/discordjs/discord.js/tree/main/packages/create-discord-bot) with your .env file populated and your Discord bot in a server. You are now ready to do what you like.
10 changes: 5 additions & 5 deletions apps/guide/src/content/03-topics/05-intents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ category: Topics

# Intents

Intents are an important part of establishing a WebSocket connection, as they define behaviour regarding gateway events and impact received data via the REST API.
Intents are an important part of establishing a WebSocket connection, as they define behavior regarding gateway events and impact received data via the REST API.

## Usage

Expand All @@ -17,17 +17,17 @@ const client = new Client({
});
```

This is the most basic usage of intents for discord.js. By specifying _`GatewayIntentBits.Guilds`_, we will receive gateway events regarding guilds. This includes receiving information about guilds as the bot starts up, such as the roles in the guild and the respective shard id.
This is the most basic usage of intents for discord.js. By specifying _`GatewayIntentBits.Guilds`_, your bot will receive gateway events regarding guilds. This includes receiving initial information about guilds it is in at startup, such as role data and the shard id to be used.

The full list of _`GatewayIntentBits`_ one can specify can be found <DiscordAPITypesLink type="enum" parent="GatewayIntentBits">on the documentation</DiscordAPITypesLink>. An explanation of what each intent does can be found [on Discord's documentation](https://discord.com/developers/docs/topics/gateway#list-of-intents).
You can find the full list of _`GatewayIntentBits`_ <DiscordAPITypesLink type="enum" parent="GatewayIntentBits">on the documentation</DiscordAPITypesLink> and an explanation of what each intent does [on Discord's API documentation](https://discord.com/developers/docs/topics/gateway#list-of-intents).

## Considerations

In discord.js, some intents require an extra bit of consideration.

### _`GatewayIntentBits.Guilds`_

discord.js relies heavily on caching in the library. It is recommended to set at least the _`GatewayIntentBits.Guilds`_ intent for discord.js to avoid these pitfalls.
discord.js relies heavily on caching in the library. We recommend you set at least the _`GatewayIntentBits.Guilds`_ intent to avoid these pitfalls.

### _`GatewayIntentBits.GuildMembers`_

Expand Down Expand Up @@ -55,7 +55,7 @@ Some gateway events are considered privileged. Currently, these are:
- _`GatewayIntentBits.GuildMembers`_
- _`GatewayIntentBits.MessageContent`_

To use these intents, you will need to enable them in the developer portal. If your bot is in over 75 guilds, you will need to verify your bot and request usage of your desired intents.
To use these intents, you will need to enable them in the developer portal. If your bot is in over 75 guilds, you will need to verify it and request usage of your desired intents.

Carefully think if you need these intents. They are opt-in so users across the platform can enjoy a higher level of privacy. Presences can expose some personal information, such as the games being played and overall online time. You might find that it isn't necessary for your bot to have this level of information about all guild members at all times.

Expand Down

0 comments on commit f473e59

Please sign in to comment.