refactor: new node features (#5132)

Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
Sugden
2021-06-30 21:40:33 +01:00
committed by GitHub
parent f108746c15
commit 1e8f01253e
68 changed files with 305 additions and 360 deletions

View File

@@ -117,7 +117,7 @@ class MessageMentions {
this.crosspostedChannels.set(d.id, {
channelID: d.id,
guildID: d.guild_id,
type: type ? type.toLowerCase() : 'unknown',
type: type?.toLowerCase() ?? 'unknown',
name: d.name,
});
}
@@ -191,11 +191,9 @@ class MessageMentions {
if (!ignoreDirect) {
const id =
this.client.users.resolveID(data) ||
(this.guild && this.guild.roles.resolveID(data)) ||
this.client.channels.resolveID(data);
this.guild?.roles.resolveID(data) ?? this.client.channels.resolveID(data) ?? this.client.users.resolveID(data);
return this.users.has(id) || this.channels.has(id) || this.roles.has(id);
return typeof id === 'string' && (this.users.has(id) || this.channels.has(id) || this.roles.has(id));
}
return false;