mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
types(Interaction): allow Interaction cached properties to be type narrowed (#6668)
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com> Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com> Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -120,6 +120,22 @@ class Interaction extends Base {
|
||||
return Boolean(this.guildId && this.member);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether or not this interaction is both cached and received from a guild.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
inCachedGuild() {
|
||||
return Boolean(this.guild && this.member);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether or not this interaction is received from an uncached guild.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
inRawGuild() {
|
||||
return Boolean(this.guildId && !this.guild && this.member);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether this interaction is a {@link CommandInteraction}.
|
||||
* @returns {boolean}
|
||||
|
||||
Reference in New Issue
Block a user