harmony_voice
1.0.0
Implémentation de l'API Discord Voice pour Deno.
const conn = new VoiceConnect ( botUserID ) ;
// Obtained from VOICE_STATE_UPDATE Gateway Event
conn . voiceStateUpdate ( { channelID , guildID , sessionID } ) ;
// Obtained from VOICE_SERVER_UPDATE
conn . voiceServerUpdate ( { token , endpoint } ) ;
conn . connect ( ) ;
// To play something
const player = conn . player ( ) ;
pcmStreamFromSomewhere . pipeTo ( player . writable ) ;
// ytdl_core example
const player = conn . player ( ) ;
const info = await getInfo ( "id" ) ; // from x/ytdl_core
new PCMStream ( stream . formats . find ( ( e ) => e . hasAudio && ! e . hasVideo ) ! . url )
. pipeTo ( player . writable ) ;
Vérifiez LICENCE pour plus d’informations.
Copyright 2022 © DjDeveloperr