From 395f928e2e3b407f8dc7589499424646d039a275 Mon Sep 17 00:00:00 2001 From: Snowflake107 Date: Thu, 24 Jun 2021 11:28:30 +0545 Subject: [PATCH] attach backup adapter creator --- src/VoiceInterface/VoiceUtils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/VoiceInterface/VoiceUtils.ts b/src/VoiceInterface/VoiceUtils.ts index 5de378c..306acfb 100644 --- a/src/VoiceInterface/VoiceUtils.ts +++ b/src/VoiceInterface/VoiceUtils.ts @@ -1,6 +1,7 @@ import { VoiceChannel, StageChannel, Collection, Snowflake } from "discord.js"; import { DiscordGatewayAdapterCreator, entersState, joinVoiceChannel, VoiceConnection, VoiceConnectionStatus } from "@discordjs/voice"; import { StreamDispatcher } from "./BasicStreamDispatcher"; +import { VoiceAdapterCreator } from "./AdapterCreator"; class VoiceUtils { public cache: Collection; @@ -53,7 +54,7 @@ class VoiceUtils { let conn = joinVoiceChannel({ guildId: channel.guild.id, channelId: channel.id, - adapterCreator: options.adapter ?? (channel.guild as any).voiceAdapterCreator, // eslint-disable-line @typescript-eslint/no-explicit-any + adapterCreator: options.adapter ?? (channel.guild as any).voiceAdapterCreator ?? VoiceAdapterCreator(channel), // eslint-disable-line @typescript-eslint/no-explicit-any selfDeaf: Boolean(options.deaf) });