Skip to content
This repository was archived by the owner on Jul 19, 2021. It is now read-only.

Commit 3647808

Browse files
committed
chore(v12-changes): add disableEveryone replacement
1 parent e5a3d87 commit 3647808

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

guide/additional-info/changes-in-v12.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ You can check your discord.js version with `npm list discord.js`. Should it stil
2020
* The use of parenthesis designates optional inclusion. For example, `TextChannel#fetch(Pinned)Message(s)` means that this section will include changes for `TextChannel#fetchPinnedMessages`, `TextChannel#fetchMessages`, and `TextChannel#fetchMessage`.
2121
* The use of asterisks designates a wildcard. For example, `TextChannel#send***` means that this section will include changes for `TextChannel#sendMessage`, `TextChannel#sendFile`, `TextChannel#sendEmbed`, and so forth.
2222

23+
:::danger
24+
25+
`clientOptions.disableEveryone` has been removed and replaced with `clientOptions.disableMentions`!
26+
27+
```diff
28+
- const client = new Discord.Client({ disableEveryone: true });
29+
+ const client = new Discord.Client({ disableMentions: "everyone" });
30+
```
31+
32+
:::
33+
2334
### Managers/ Cache
2435

2536
v12 introduces the concept of managers, you will no longer be able to directly use collection methods such as `Collection#get` on data structures like `Client#users`. You will now have to directly ask for cache on a manager before trying to use collection methods. Any method that is called directly on a manager will call the API, such as `GuildMemberManager#fetch` and `MessageManager#delete`.
@@ -2081,6 +2092,15 @@ ClientApplication.coverImage({ width: 1024, height: 1024 });
20812092

20822093
### ClientOptions
20832094

2095+
#### ClientOptions#disableEveryone
2096+
2097+
`clientOptions.disableEveryone` has been removed and replaced with `clientOptions.disableMentions`. The former was a best effort approach to escape the everyone mention before sending it off to discord. The API has since introduced a way to deal with this properly on their end which we make use of in version 12 through `clientOptions.disableMentions`.
2098+
2099+
```diff
2100+
- const client = new Discord.Client({ disableEveryone: true });
2101+
+ const client = new Discord.Client({ disableMentions: "everyone" });
2102+
```
2103+
20842104
#### ClientOptions#partials
20852105

20862106
`clientOptions.partials` has been added to allow for partial structures - see the `Partials` section of the guide for more details.

0 commit comments

Comments
 (0)