fix(Player): add intents checking
This commit is contained in:
parent
83d692801a
commit
5780e6e6f4
1 changed files with 5 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
import { Client, Collection, GuildResolvable, Snowflake, User, VoiceState } from "discord.js";
|
||||
import { Client, Collection, GuildResolvable, Snowflake, User, VoiceState, Intents } from "discord.js";
|
||||
import { TypedEmitter as EventEmitter } from "tiny-typed-emitter";
|
||||
import { Queue } from "./Structures/Queue";
|
||||
import { VoiceUtils } from "./VoiceInterface/VoiceUtils";
|
||||
|
@ -46,6 +46,10 @@ class Player extends EventEmitter<PlayerEvents> {
|
|||
*/
|
||||
this.client = client;
|
||||
|
||||
if (new Intents(this.client.options.intents).has(Intents.FLAGS.GUILD_VOICE_STATES)) {
|
||||
throw new PlayerError('client is missing "GUILD_VOICE_STATES" intent');
|
||||
}
|
||||
|
||||
/**
|
||||
* The extractors collection
|
||||
* @type {ExtractorModel}
|
||||
|
|
Loading…
Reference in a new issue