Skip to content

Commit 54c7510

Browse files
authored
chore: relabel branch selector and adapt doc references (discordjs#395)
1 parent 51331ed commit 54c7510

File tree

13 files changed

+40
-40
lines changed

13 files changed

+40
-40
lines changed

guide/.vuepress/branches.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
export default [
22
{
3-
label: 'v12.x (stable)',
3+
label: 'v12 (stable)',
44
version: '12.x',
55
aliases: ['12', 'stable'],
66
},
77
{
8-
label: 'v11.5',
8+
label: 'v11',
99
version: '11.x',
1010
aliases: ['11'],
1111
},

guide/command-handling/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const client = new Discord.Client();
8181
:::
8282

8383
::: tip
84-
If you aren't exactly sure what Collections are, they're a class that extend JS's native Map class and include more extensive, useful functionality. You can read about Maps [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map), and see all the available Collection methods <branch version="11.x" inline>[here](https://discord.js.org/#/docs/main/11.5.1/class/Collection)</branch><branch version="12.x" inline>[here](https://discord.js.org/#/docs/collection/master/class/Collection)</branch>.
84+
If you aren't exactly sure what Collections are, they're a class that extend JS's native Map class and include more extensive, useful functionality. You can read about Maps [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map), and see all the available Collection methods <branch version="11.x" inline>[here](https://discord.js.org/#/docs/main/v11/class/Collection)</branch><branch version="12.x" inline>[here](https://discord.js.org/#/docs/collection/master/class/Collection)</branch>.
8585
:::
8686

8787
This next step is how you'll dynamically retrieve all your newly created command files. Add this below your `client.commands` line:

guide/command-handling/adding-features.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ There's nothing really complex here; all you do is append some strings, `.map()`
328328
Since help messages can get messy, you'll be DMing it to the message author instead of posting it in the requested channel. However, there is something very important you should consider: the possibility of not being able to DM the user, whether it be that they have DMs disabled on that server or overall, or they have the bot blocked. For that reason, you should `.catch()` it and let them know.
329329

330330
::: tip
331-
If you weren't already aware, `.send()` takes 2 parameters: the content to send, and the message options to pass in. You can read about the `MessageOptions` type <branch version="11.x" inline>[here](https://discord.js.org/#/docs/main/11.5.1/typedef/MessageOptions)</branch><branch version="12.x" inline>[here](https://discord.js.org/#/docs/main/stable/typedef/MessageOptions)</branch>. Using `split: true` here will automatically split our help message into 2 or more messages in the case that it exceeds the 2,000 character limit.
331+
If you weren't already aware, `.send()` takes 2 parameters: the content to send, and the message options to pass in. You can read about the `MessageOptions` type <branch version="11.x" inline>[here](https://discord.js.org/#/docs/main/v11/typedef/MessageOptions)</branch><branch version="12.x" inline>[here](https://discord.js.org/#/docs/main/stable/typedef/MessageOptions)</branch>. Using `split: true` here will automatically split our help message into 2 or more messages in the case that it exceeds the 2,000 character limit.
332332
:::
333333

334334
::: tip
@@ -383,7 +383,7 @@ At the end of it all, you should be getting this as a result:
383383
No more manually editing your help command! If you aren't completely satisfied with how it looks, you can always adjust it to your liking later.
384384

385385
::: tip
386-
If you want to add categories or other information to your commands you can simply add properties reflecting it to your `module.exports`. If you only want to show a subset of commands remember that `commands` is a Collection you can <branch version="11.x" inline>[filter](https://discord.js.org/#/docs/main/11.5.1/class/Collection?scrollTo=filter)</branch><branch version="12.x" inline>[filter](https://discord.js.org/#/docs/collection/master/class/Collection?scrollTo=filter)</branch> to fit your specific needs!
386+
If you want to add categories or other information to your commands you can simply add properties reflecting it to your `module.exports`. If you only want to show a subset of commands remember that `commands` is a Collection you can <branch version="11.x" inline>[filter](https://discord.js.org/#/docs/main/v11/class/Collection?scrollTo=filter)</branch><branch version="12.x" inline>[filter](https://discord.js.org/#/docs/collection/master/class/Collection?scrollTo=filter)</branch> to fit your specific needs!
387387
:::
388388

389389
## Reloading commands

guide/commando/permissions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ super(client, {
4444
});
4545
```
4646

47-
All you need to do is set the properties to an array of permission flags. A list of those can be found <branch version="11.x" inline>[here](https://discord.js.org/#/docs/main/11.5.1/class/Permissions?scrollTo=s-FLAGS)</branch><branch version="12.x" inline>[here](https://discord.js.org/#/docs/main/stable/class/Permissions?scrollTo=s-FLAGS)</branch>.
47+
All you need to do is set the properties to an array of permission flags. A list of those can be found <branch version="11.x" inline>[here](https://discord.js.org/#/docs/main/v11/class/Permissions?scrollTo=s-FLAGS)</branch><branch version="12.x" inline>[here](https://discord.js.org/#/docs/main/stable/class/Permissions?scrollTo=s-FLAGS)</branch>.
4848

4949
## Owner-only commands
5050

guide/creating-your-bot/adding-more-commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ That would display both the server name _and_ the amount of members in it.
118118
You can, of course, modify this to your liking. You may want to also display the date the server was created, or the server's region. You would do those in the same manner - use `message.guild.createdAt` or `message.guild.region`, respectively.
119119

120120
::: tip
121-
Want a list of all the properties you can access and all the methods you can call on a server? Refer to <branch version="11.x" inline>[the discord.js documentation site](https://discord.js.org/#/docs/main/11.5.1/class/Guild)</branch><branch version="12.x" inline>[the discord.js documentation site](https://discord.js.org/#/docs/main/stable/class/Guild)</branch>!
121+
Want a list of all the properties you can access and all the methods you can call on a server? Refer to <branch version="11.x" inline>[the discord.js documentation site](https://discord.js.org/#/docs/main/v11/class/Guild)</branch><branch version="12.x" inline>[the discord.js documentation site](https://discord.js.org/#/docs/main/stable/class/Guild)</branch>!
122122
:::
123123

124124
### Member info command
@@ -146,7 +146,7 @@ This will display the message author's **username** (not nickname, if they have
146146
</div>
147147

148148
::: tip
149-
`message.author` refers to the user who sent the message. For a full list of all the properties and methods for the author object (a member of the `User` class), check out <branch version="11.x" inline>[the documentation page for it](https://discord.js.org/#/docs/main/11.5.1/class/User)</branch><branch version="12.x" inline>[the documentation page for it](https://discord.js.org/#/docs/main/stable/class/User)</branch>.
149+
`message.author` refers to the user who sent the message. For a full list of all the properties and methods for the author object (a member of the `User` class), check out <branch version="11.x" inline>[the documentation page for it](https://discord.js.org/#/docs/main/v11/class/User)</branch><branch version="12.x" inline>[the documentation page for it](https://discord.js.org/#/docs/main/stable/class/User)</branch>.
150150
:::
151151

152152
And there you have it! As you can see, it's quite simple to add additional commands.

guide/miscellaneous/parsing-mention-arguments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Here is how the RegEx works:
227227
Using the `.match()` method on strings you can get the values of the capture group, i.e., the ID of the mention.
228228

229229
::: warning
230-
Discord.js has <branch version="11.x" inline>[built-in patterns](https://discord.js.org/#/docs/main/11.5.1/class/MessageMentions?scrollTo=s-CHANNELS_PATTERN)</branch><branch version="12.x" inline>[built-in patterns](https://discord.js.org/#/docs/main/stable/class/MessageMentions?scrollTo=s-CHANNELS_PATTERN)</branch>
230+
Discord.js has <branch version="11.x" inline>[built-in patterns](https://discord.js.org/#/docs/main/v11/class/MessageMentions?scrollTo=s-CHANNELS_PATTERN)</branch><branch version="12.x" inline>[built-in patterns](https://discord.js.org/#/docs/main/stable/class/MessageMentions?scrollTo=s-CHANNELS_PATTERN)</branch>
231231
for matching mentions, however as of version 11.4 they do not contain any groups
232232
and thus aren't useful for actually getting the ID out of the mention.
233233
:::

guide/popular-topics/collectors.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Collectors are a useful way to enable your bot to obtain *additional* input after the first command was sent. An example would be initiating a quiz, where the bot will "await" a correct response from somebody.
66

77
::: tip
8-
You can read the docs for the Collector class <branch version="11.x" inline>[here](https://discord.js.org/#/docs/main/11.5.1/class/Collector)</branch><branch version="12.x" inline>[here](https://discord.js.org/#/docs/main/stable/class/Collector)</branch>.
8+
You can read the docs for the Collector class <branch version="11.x" inline>[here](https://discord.js.org/#/docs/main/v11/class/Collector)</branch><branch version="12.x" inline>[here](https://discord.js.org/#/docs/main/stable/class/Collector)</branch>.
99
:::
1010

1111
### Basic message collector
@@ -43,7 +43,7 @@ Those options you pass as the second argument in `.createMessageCollector()`. Th
4343
Using `.awaitMessages()` can be easier if you understand promises, and it allows you to have cleaner code overall. It is essentially identical to `.createMessageCollector()`, except promisified. The drawback of using this method, however, is that you cannot do things before the promise is resolved or rejected, either by an error or completion. However, it should do for most purposes, such as awaiting the correct response in a quiz. Instead of taking their example, let's set up a basic quiz command using the `.awaitMessages()` feature.
4444

4545
::: tip
46-
You can read the docs for the `.awaitMessages()` method <branch version="11.x" inline>[here](https://discord.js.org/#/docs/main/11.5.1/class/TextChannel?scrollTo=awaitMessages)</branch><branch version="12.x" inline>[here](https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=awaitMessages)</branch>.
46+
You can read the docs for the `.awaitMessages()` method <branch version="11.x" inline>[here](https://discord.js.org/#/docs/main/v11/class/TextChannel?scrollTo=awaitMessages)</branch><branch version="12.x" inline>[here](https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=awaitMessages)</branch>.
4747
:::
4848

4949
First, you'll need some questions and answers to choose from, so here's a basic set:
@@ -121,7 +121,7 @@ The filter looks for messages that match one of the answers in our array of poss
121121
These work quite similarly to message collectors, except that you apply them on a message rather than a channel. The following is an example taken from the documentation, with slightly better variable names for clarification. The filter will check for the 👌 emoji - in the default skin tone specifically, so be wary of that. It will also check that the person who reacted shares the same id as the author of the original message that the collector was assigned to.
122122

123123
::: tip
124-
You can read the docs for the `.createReactionCollector()` method <branch version="11.x" inline>[here](https://discord.js.org/#/docs/main/11.5.1/class/Message?scrollTo=createReactionCollector)</branch><branch version="12.x" inline>[here](https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=createReactionCollector)</branch>.
124+
You can read the docs for the `.createReactionCollector()` method <branch version="11.x" inline>[here](https://discord.js.org/#/docs/main/v11/class/Message?scrollTo=createReactionCollector)</branch><branch version="12.x" inline>[here](https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=createReactionCollector)</branch>.
125125
:::
126126

127127
<branch version="11.x">
@@ -168,7 +168,7 @@ collector.on('end', collected => {
168168
As before, these work almost exactly the same as a reaction collector, except it is promise based. The same differences apply as with channel collectors.
169169

170170
::: tip
171-
You can read the docs for the `.awaitReactions()` method <branch version="11.x" inline>[here](https://discord.js.org/#/docs/main/11.5.1/class/Message?scrollTo=awaitReactions)</branch><branch version="12.x" inline>[here](https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=awaitReactions)</branch>.
171+
You can read the docs for the `.awaitReactions()` method <branch version="11.x" inline>[here](https://discord.js.org/#/docs/main/v11/class/Message?scrollTo=awaitReactions)</branch><branch version="12.x" inline>[here](https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=awaitReactions)</branch>.
172172
:::
173173

174174
```js

guide/popular-topics/embeds.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Here is an example of what an embed may look like. We will go over their constru
4949

5050
## Using the <branch version="11.x" inline>RichEmbed</branch><branch version="12.x" inline>MessageEmbed</branch> constructor
5151

52-
Discord.js features the utility class <branch version="11.x" inline>[RichEmbed](https://discord.js.org/#/docs/main/11.5.1/class/MessageEmbed)</branch><branch version="12.x" inline>[MessageEmbed](https://discord.js.org/#/docs/main/stable/class/MessageEmbed)</branch> for easy construction and manipulation of embeds.
52+
Discord.js features the utility class <branch version="11.x" inline>[RichEmbed](https://discord.js.org/#/docs/main/v11/class/MessageEmbed)</branch><branch version="12.x" inline>[MessageEmbed](https://discord.js.org/#/docs/main/stable/class/MessageEmbed)</branch> for easy construction and manipulation of embeds.
5353

5454
<branch version="11.x">
5555

@@ -116,7 +116,7 @@ channel.send(exampleEmbed);
116116
You don't need to include all the elements showcased above. If you want a simpler embed, just leave some out.
117117
:::
118118

119-
The `.setColor()` method accepts an integer, HEX color string, an array of RGB values or specific color strings. You can find a list of them at <branch version="11.x" inline>[the Discord.js documentation](https://discord.js.org/#/docs/main/11.5.1/typedef/ColorResolvable)</branch><branch version="12.x" inline>[the Discord.js documentation](https://discord.js.org/#/docs/main/stable/typedef/ColorResolvable)</branch>.
119+
The `.setColor()` method accepts an integer, HEX color string, an array of RGB values or specific color strings. You can find a list of them at <branch version="11.x" inline>[the Discord.js documentation](https://discord.js.org/#/docs/main/v11/typedef/ColorResolvable)</branch><branch version="12.x" inline>[the Discord.js documentation](https://discord.js.org/#/docs/main/stable/typedef/ColorResolvable)</branch>.
120120

121121
<branch version="11.x">
122122

@@ -161,7 +161,7 @@ if (message.author.bot) {
161161

162162
### Attaching images
163163

164-
You can use the `.attachFiles()` method to upload images alongside your embed and use them as source for embed fields that support image urls. The method accepts the source file as file path <branch version="11.x" inline>[FileOptions](https://discord.js.org/#/docs/main/11.5.1/typedef/FileOptions)</branch><branch version="12.x" inline>[FileOptions](https://discord.js.org/#/docs/main/stable/typedef/FileOptions)</branch>, BufferResolvable (including a URL to an external image), or Attachment objects inside an array.
164+
You can use the `.attachFiles()` method to upload images alongside your embed and use them as source for embed fields that support image urls. The method accepts the source file as file path <branch version="11.x" inline>[FileOptions](https://discord.js.org/#/docs/main/v11/typedef/FileOptions)</branch><branch version="12.x" inline>[FileOptions](https://discord.js.org/#/docs/main/stable/typedef/FileOptions)</branch>, BufferResolvable (including a URL to an external image), or Attachment objects inside an array.
165165

166166
You can then reference and use the images inside the embed itself with `attachment://fileName.extension`.
167167

@@ -279,7 +279,7 @@ if (message.author.bot) {
279279

280280
### Attaching images
281281

282-
You can upload images with your embedded message and use them as source for embed fields that support image urls by constructing <branch version="11.x" inline>an [Attachment](https://discord.js.org/#/docs/main/11.5.1/class/Attachment)</branch><branch version="12.x" inline>a [MessageAttachment](https://discord.js.org/#/docs/main/stable/class/MessageAttachment)</branch> from them to send as message option alongside the embed. The <branch version="11.x" inline>file</branch><branch version="12.x" inline>attachment</branch> parameter takes a BufferResolvable or Stream including the URL to an external image.
282+
You can upload images with your embedded message and use them as source for embed fields that support image urls by constructing <branch version="11.x" inline>an [Attachment](https://discord.js.org/#/docs/main/v11/class/Attachment)</branch><branch version="12.x" inline>a [MessageAttachment](https://discord.js.org/#/docs/main/stable/class/MessageAttachment)</branch> from them to send as message option alongside the embed. The <branch version="11.x" inline>file</branch><branch version="12.x" inline>attachment</branch> parameter takes a BufferResolvable or Stream including the URL to an external image.
283283

284284
You can then reference and use the images inside the embed itself with `attachment://fileName.extension`.
285285

0 commit comments

Comments
 (0)