harmony_voice
1.0.0
Implementasi Discord Voice API untuk 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 ) ;
Periksa LISENSI untuk info lebih lanjut.
Hak Cipta 2022 © DjDeveloperr