Skip to content

Commit a97ac82

Browse files
fix(guide): Miscellaneous fixes (#11147)
* fix: miscellaneous fixes * docs: fix contributing link * fix: link * fix: you * fix: main links * fix: update source * fix: update link * fix: update update link * fix: [ * fix: remove locale * fix: update links * fix: update GitHub link --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 7f29356 commit a97ac82

File tree

47 files changed

+113
-115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+113
-115
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ If you don't understand something in the documentation, you are experiencing pro
6565
[website]: https://discord.js.org
6666
[website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
6767
[documentation]: https://discord.js.org/docs
68-
[guide]: https://discordjs.guide/
69-
[guide-source]: https://github.com/discordjs/guide
70-
[guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html
68+
[guide]: https://discordjs.guide
69+
[guide-source]: https://github.com/discordjs/discord.js/tree/main/apps/guide
70+
[guide-update]: https://discordjs.guide/legacy/additional-info/changes-in-v14
7171
[discord]: https://discord.gg/djs
7272
[discord-developers]: https://discord.gg/discord-developers
7373
[source]: https://github.com/discordjs/discord.js/tree/main/packages/discord.js

apps/guide/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424

2525
## Contributing
2626

27-
Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the existing guide.
28-
See [the contribution guide][./contributing] if you'd like to submit a PR.
27+
Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the existing guide. See [the contributing guide][contributing] if you'd like to submit a pull request.
2928

3029
## Local Development
3130

@@ -38,9 +37,9 @@ If you don't understand something in the documentation, you are experiencing pro
3837
[website]: https://discord.js.org
3938
[website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
4039
[documentation]: https://discord.js.org/docs
41-
[guide]: https://discord.js/guide
40+
[guide]: https://discordjs.guide
4241
[guide-source]: https://github.com/discordjs/discord.js/tree/main/apps/guide
43-
[guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html
42+
[guide-update]: https://discordjs.guide/legacy/additional-info/changes-in-v14
4443
[discord]: https://discord.gg/djs
4544
[source]: https://github.com/discordjs/discord.js/tree/main/apps/guide
4645
[contributing]: https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md

apps/guide/content/docs/legacy/additional-info/async-await.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ client.on(Events.InteractionCreate, (interaction) => {
143143
});
144144
```
145145

146-
In this piece of code, the Promises are [chain resolved](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then#Chaining) with each other, and if one of the Promises gets rejected, the function passed to `.catch()` gets called. Here's the same code but with async/await:
146+
In this piece of code, the Promises are [chain resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/then#Chaining) with each other, and if one of the Promises gets rejected, the function passed to `.catch()` gets called. Here's the same code but with async/await:
147147

148148
```js title="promise-example.js" lineNumbers=9
149149
client.on(Events.InteractionCreate, async (interaction) => {

apps/guide/content/docs/legacy/additional-info/changes-in-v14.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ You can no longer use the `deleted` property to check if a structure was deleted
519519

520520
### ApplicationCommand
521521

522-
NFSW commands are supported.
522+
NSFW commands are supported.
523523

524524
### Attachment
525525

apps/guide/content/docs/legacy/additional-info/collections.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ It extends JavaScript's native `Map` class, so it has all the `Map` features and
77

88
<Callout type="warn">
99
If you're not familiar with `Map`, read [MDN's page on
10-
it](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) before continuing. You
11-
should be familiar with `Array`
12-
[methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) as well. We will
13-
also use some ES6 features, so read up [here](./es6-syntax) if you do not know what they are.
10+
it](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) before continuing. You should be
11+
familiar with `Array` [methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) as
12+
well. We will also use some ES6 features, so read up [here](./es6-syntax) if you do not know what they are.
1413
</Callout>
1514

1615
A `Map` allows for an association between unique keys and their values.
@@ -45,7 +44,7 @@ Methods that follow this philosophy of staying close to the `Array` interface ar
4544

4645
## Converting to Array
4746

48-
Since `Collection` extends `Map`, it is an [iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), and can be converted to an `Array` through either `Array.from()` or spread syntax (`...collection`).
47+
Since `Collection` extends `Map`, it is an [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols), and can be converted to an `Array` through either `Array.from()` or spread syntax (`...collection`).
4948

5049
```js
5150
// For values.

apps/guide/content/docs/legacy/additional-info/rest-api.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const { request } = require('undici');
6969
showcase!
7070
</Callout>
7171

72-
Random cat's API is available at [https://aws.random.cat/meow](https://aws.random.cat/meow) and returns a [JSON](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON) response. To actually fetch data from the API, you're going to do the following:
72+
Random cat's API is available at [https://aws.random.cat/meow](https://aws.random.cat/meow) and returns a [JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON) response. To actually fetch data from the API, you're going to do the following:
7373

7474
```js
7575
const catResult = await request('https://aws.random.cat/meow');
@@ -119,7 +119,7 @@ client.on(Events.InteractionCreate, async (interaction) => {
119119
});
120120
```
121121

122-
Here, you are using JavaScript's native [URLSearchParams class](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) to create a [query string](https://en.wikipedia.org/wiki/Query_string) for the URL so that the Urban Dictionary server can parse it and know what you want to look up.
122+
Here, you are using JavaScript's native [URLSearchParams class](https://developer.mozilla.org/docs/Web/API/URLSearchParams) to create a [query string](https://en.wikipedia.org/wiki/Query_string) for the URL so that the Urban Dictionary server can parse it and know what you want to look up.
123123

124124
If you were to do `/urban hello world`, then the URL would become https://api.urbandictionary.com/v0/define?term=hello%20world since the string `"hello world"` is encoded.
125125

apps/guide/content/docs/legacy/app-creation/deploying-commands.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Create a `deploy-commands.js` file in your project directory. This file will be
4949
Add two more properties to your `config.json` file, which we'll need in the deployment script:
5050

5151
- `clientId`: Your application's client id ([Discord Developer Portal](https://discord.com/developers/applications) > "General Information" > application id)
52-
- `guildId`: Your development server's id ([Enable developer mode](https://support.discord.com/hc/en-us/articles/206346498) > Right-click the server title > "Copy ID")
52+
- `guildId`: Your development server's id ([Enable developer mode](https://support.discord.com/hc/articles/206346498) > Right-click the server title > "Copy ID")
5353

5454
```json title="config.json"
5555
{

apps/guide/content/docs/legacy/app-creation/handling-commands.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ We recommend attaching a `.commands` property to your client instance so that yo
6464
native path utility module. `path` helps construct paths to access files and directories. One of the advantages of the
6565
`path` module is that it automatically detects the operating system and uses the appropriate joiners. - The
6666
`Collection` class extends JavaScript's native
67-
[`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) class, and includes more
67+
[`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) class, and includes more
6868
extensive, useful functionality. `Collection` is used to store and efficiently retrieve commands for execution.
6969
</Callout>
7070

apps/guide/content/docs/legacy/app-creation/handling-events.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ You'll notice the code looks very similar to the command loading above it - read
204204
205205
The `Client` class in discord.js extends the [`EventEmitter`](https://nodejs.org/api/events.html#events_class_eventemitter) class. Therefore, the `client` object exposes the [`.on()`](https://nodejs.org/api/events.html#events_emitter_on_eventname_listener) and [`.once()`](https://nodejs.org/api/events.html#events_emitter_once_eventname_listener) methods that you can use to register event listeners. These methods take two arguments: the event name and a callback function. These are defined in your separate event files as `name` and `execute`.
206206
207-
The callback function passed takes argument(s) returned by its respective event, collects them in an `args` array using the `...` [rest parameter syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters), then calls `event.execute()` while passing in the `args` array using the `...` [spread syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax). They are used here because different events in discord.js have different numbers of arguments. The rest parameter collects these variable number of arguments into a single array, and the spread syntax then takes these elements and passes them to the `execute` function.
207+
The callback function passed takes argument(s) returned by its respective event, collects them in an `args` array using the `...` [rest parameter syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), then calls `event.execute()` while passing in the `args` array using the `...` [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax). They are used here because different events in discord.js have different numbers of arguments. The rest parameter collects these variable number of arguments into a single array, and the spread syntax then takes these elements and passes them to the `execute` function.
208208
209209
After this, listening for other events is as easy as creating a new file in the `events` folder. The event handler will automatically retrieve and register it whenever you restart your bot.
210210

apps/guide/content/docs/legacy/app-creation/project-setup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ console.log(token);
3333

3434
## Using environment variables
3535

36-
Environment variables are, as the name suggets, values you can pass to your environment (e.g. terminal session, Docker container, node process). This has the benefit that you can keep your code the same for different execution contexts.
36+
Environment variables are, as the name suggests, values you can pass to your environment (e.g. terminal session, Docker container, node process). This has the benefit that you can keep your code the same for different execution contexts.
3737

3838
```txt title=".env"
3939
A=Hello World

0 commit comments

Comments
 (0)