const shell = module.require("discord.js");
const fs = require("fs");
const ffmpeg = require('ffmpeg');
const ytdl = require('ytdl-core');
const queue = new Map();
module.exports.run = async (bot,message,args) => {
if(!args[0]){
bot.send('You forgot to enter a command!')
return
}
if(args[0]=='join'){
if(message.member.voiceChannel){
const connection = await message.member.voiceChannel.join();
console.log(connection)
}else{
bot.send('You are not connected to voice chat!')
}
}
if(args[0]=='test'){
const connection = await message.member.voiceChannel
const dispatcher = connection.play('e:/Programs/GitHub/castielbot/music/test/ChaosInsurgencyTheme.m4a');
console.log(connection)
console.log(dispatcher)
}
if(args[0]=='leave'){
const connection = await message.member.voiceChannel.leave();
console.log(connection)
}
};
module.exports.help = {
name: "m"
};
npm install https://github.com/discordjs/discord.js
Find more questions by tags DiscordJavaScript