feat: reimplement disableEveryone into disableMentions

* User input sanitation: reimplement disableEveryone into disableMentions

* Change default value of ClientOptions#disableMentions to 'none'

* Update type declarations of disableMentions to include default

* update for compliance with ESLint

* Overlooked these files. Updated for complete compliance with ESLint
This commit is contained in:
Papa
2020-02-29 06:20:39 -07:00
committed by GitHub
parent bbe169deac
commit 9c8aaf1bbc
8 changed files with 51 additions and 29 deletions

View File

@@ -386,8 +386,8 @@ class Client extends BaseClient {
if (typeof options.fetchAllMembers !== 'boolean') {
throw new TypeError('CLIENT_INVALID_OPTION', 'fetchAllMembers', 'a boolean');
}
if (typeof options.disableMentions !== 'boolean') {
throw new TypeError('CLIENT_INVALID_OPTION', 'disableMentions', 'a boolean');
if (typeof options.disableMentions !== 'string') {
throw new TypeError('CLIENT_INVALID_OPTION', 'disableMentions', 'a string');
}
if (!Array.isArray(options.partials)) {
throw new TypeError('CLIENT_INVALID_OPTION', 'partials', 'an Array');