import { patchClass } from '../utilities/Patcher' ; const StreamDispatcher = require ( 'discord.js/src/client/voice/dispatcher/StreamDispatcher' ) ; class StreamDispatcherPatch { _sendPacket ( this , packet ) { if ( ! this . player . voiceConnection . sockets . udp ) { this . emit ( 'debug' , 'Failed to send a packet - no UDP socket' ) ; return ; } this . player . voiceConnection . sockets . udp . send ( packet ) . catch ( ( e ) => { this . emit ( 'debug' , `Failed to send a packet - ${ e }` ) ; } ) ; } } patchClass ( StreamDispatcher . prototype , StreamDispatcherPatch ) ;