mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
feat(Channel): add isVoice() (#6297)
This commit is contained in:
@@ -9,7 +9,7 @@ let StoreChannel;
|
||||
let TextChannel;
|
||||
let ThreadChannel;
|
||||
let VoiceChannel;
|
||||
const { ChannelTypes, ThreadChannelTypes } = require('../util/Constants');
|
||||
const { ChannelTypes, ThreadChannelTypes, VoiceBasedChannelTypes } = require('../util/Constants');
|
||||
const SnowflakeUtil = require('../util/SnowflakeUtil');
|
||||
|
||||
/**
|
||||
@@ -117,6 +117,15 @@ class Channel extends Base {
|
||||
return 'messages' in this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether this channel is voice-based
|
||||
* ({@link VoiceChannel} or {@link StageChannel}).
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isVoice() {
|
||||
return VoiceBasedChannelTypes.includes(this.type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether this channel is a {@link ThreadChannel}.
|
||||
* @returns {boolean}
|
||||
|
||||
Reference in New Issue
Block a user