constda=require('discordaudiov13')client.on('messageCreate',asyncmessage=>{constmsg=da.init(message,client).message// Join the same voice channel of the author of the messageif(message.content==="join"){if(message.member.voice.channel){constconnection=msg.member.voice.channel.join();}}});
Playing Audio
constda=require('discordaudiov13')constprefix="!"client.on('messageCreate',asyncmessage=>{if(!message.content.startsWith(prefix)||message.author.bot)return;constargs=message.content.slice(prefix.length).trim().split(' ');constcommand=args.shift().toLowerCase();constmsg=da.init(message,client).message// Join the same voice channel of the author of the messageif(command==="audio"){constconnection=msg.member.voice.channel.join();constoptions={inlineVolume: data,inputType: data,silencePaddingFrames: data,metadata: data}connection.setSelfDeaf(true)// default falseconstdispatcher=connection.play('URL/Path As in v12',options/*Options in Beta and will be according to v13*/)if(args[0]=="pause"){dispatcher.pause()}elseif(args[0]=="disconnect"){dispatcher.disconnect()}elseif(args[0]=="resume"){dispatcher.resume()}elseif(args[0]=="volume"){dispatcher.setVolume(args[1]||0.25)}}});
All Functions
constda=require('discordaudiov13')constmsg=da.init(message,client).messageconstconnection=message.member.voice.channel.join()connection.setSelfDeaf(true)// default is falseconnection.setSelfMute(true)// default is falseconstdispatcher=connection.play(`URL/Path As in v12`)dispatcher.pause()dispatcher.resume()dispatcher.distroy()dispatcher.disconnect()dispatcher.rejoin()dispatcher.setVolume(SomeNumber)