|
5 | 5 | 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. |
6 | 6 |
|
7 | 7 | ::: 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>. |
9 | 9 | ::: |
10 | 10 |
|
11 | 11 | ### Basic message collector |
@@ -43,7 +43,7 @@ Those options you pass as the second argument in `.createMessageCollector()`. Th |
43 | 43 | 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. |
44 | 44 |
|
45 | 45 | ::: 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>. |
47 | 47 | ::: |
48 | 48 |
|
49 | 49 | 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 |
121 | 121 | 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. |
122 | 122 |
|
123 | 123 | ::: 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>. |
125 | 125 | ::: |
126 | 126 |
|
127 | 127 | <branch version="11.x"> |
@@ -168,7 +168,7 @@ collector.on('end', collected => { |
168 | 168 | 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. |
169 | 169 |
|
170 | 170 | ::: 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>. |
172 | 172 | ::: |
173 | 173 |
|
174 | 174 | ```js |
|
0 commit comments