66 joinVoiceChannel ,
77 VoiceConnectionStatus ,
88} from '@discordjs/voice' ;
9- import { createDiscordJSAdapter } from './music/adapter' ;
109import { Track } from './music/track' ;
1110import { MusicSubscription } from './music/subscription' ;
1211
@@ -86,7 +85,7 @@ client.on('interaction', async (interaction: Interaction) => {
8685 joinVoiceChannel ( {
8786 channelId : channel . id ,
8887 guildId : channel . guild . id ,
89- adapterCreator : createDiscordJSAdapter ( channel ) ,
88+ adapterCreator : channel . guild . voiceAdapterCreator ,
9089 } ) ,
9190 ) ;
9291 subscription . voiceConnection . on ( 'error' , console . warn ) ;
@@ -113,14 +112,14 @@ client.on('interaction', async (interaction: Interaction) => {
113112 // Attempt to create a Track from the user's video URL
114113 const track = await Track . from ( url , {
115114 onStart ( ) {
116- interaction . followUp ( 'Now playing!' , { ephemeral : true } ) . catch ( console . warn ) ;
115+ interaction . followUp ( { content : 'Now playing!' , ephemeral : true } ) . catch ( console . warn ) ;
117116 } ,
118117 onFinish ( ) {
119- interaction . followUp ( 'Now finished!' , { ephemeral : true } ) . catch ( console . warn ) ;
118+ interaction . followUp ( { content : 'Now finished!' , ephemeral : true } ) . catch ( console . warn ) ;
120119 } ,
121120 onError ( error ) {
122121 console . warn ( error ) ;
123- interaction . followUp ( `Error: ${ error . message } ` , { ephemeral : true } ) . catch ( console . warn ) ;
122+ interaction . followUp ( { content : `Error: ${ error . message } ` , ephemeral : true } ) . catch ( console . warn ) ;
124123 } ,
125124 } ) ;
126125 // Enqueue the track and reply a success message to the user
@@ -160,22 +159,22 @@ client.on('interaction', async (interaction: Interaction) => {
160159 } else if ( interaction . commandName === 'pause' ) {
161160 if ( subscription ) {
162161 subscription . audioPlayer . pause ( ) ;
163- await interaction . reply ( `Paused!` , { ephemeral : true } ) ;
162+ await interaction . reply ( { content : `Paused!` , ephemeral : true } ) ;
164163 } else {
165164 await interaction . reply ( 'Not playing in this server!' ) ;
166165 }
167166 } else if ( interaction . commandName === 'resume' ) {
168167 if ( subscription ) {
169168 subscription . audioPlayer . unpause ( ) ;
170- await interaction . reply ( `Unpaused!` , { ephemeral : true } ) ;
169+ await interaction . reply ( { content : `Unpaused!` , ephemeral : true } ) ;
171170 } else {
172171 await interaction . reply ( 'Not playing in this server!' ) ;
173172 }
174173 } else if ( interaction . commandName === 'leave' ) {
175174 if ( subscription ) {
176175 subscription . voiceConnection . destroy ( ) ;
177176 subscriptions . delete ( interaction . guildID ) ;
178- await interaction . reply ( `Left channel!` , { ephemeral : true } ) ;
177+ await interaction . reply ( { content : `Left channel!` , ephemeral : true } ) ;
179178 } else {
180179 await interaction . reply ( 'Not playing in this server!' ) ;
181180 }
0 commit comments