Skip to content

Discord Voice API implementation for Deno, built on modern Web Streams API.

License

Notifications You must be signed in to change notification settings

harmonyland/harmony_voice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

harmony_voice

Discord Voice API implementation for Deno.

Features

  • Built on modern Web Streams API.
  • Works with any Discord API library with some effort.
  • Experimental Voice Receive support.

Usage

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);

License

Check LICENSE for more info.

Copyright 2022 © DjDeveloperr

About

Discord Voice API implementation for Deno, built on modern Web Streams API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published