I want to make a music bot in my command handler, but I ran into some problems. This is the command handler I use:
delete require.cache[require.resolve(`./commands/${command}.js`)];
let commandFile = require(`./commands/${command}.js`);
commandFile.run(client, message, args);
And in my play.js file I have a queue:
var servers = {};
I don't know how to make it so that I can skip a song (using the skip command - skip.js) in the queue. Code for skipping:
if (server.dispatcher) server.dispatcher.end();
I tried looking at tutorials but they all do it in one file wich makes it easier because you can just put the "var servers = {};" on the top and its going to work. I couldn't find any tutorials where they shown how to make it so that you can use a command handler like mine.
Here are all the files:
play.js - https://hastebin.com/dijavugufu.js
skip.js - https://hastebin.com/kupecayotu.js
It would also be nice if someone told me how to modify some other music bot commands to work with a command handler.