Make soundreload more useful

This commit is contained in:
TheEssem 2021-03-05 15:13:54 -06:00
parent 2499fb2a3b
commit f0c685d8c4
2 changed files with 5 additions and 1 deletions

View file

@ -2,6 +2,7 @@ const player = require("../utils/soundplayer.js");
// run when a raw packet is sent, used for sending data to lavalink
module.exports = async (packet) => {
if (!player.manager) return;
switch (packet.t) {
case "VOICE_SERVER_UPDATE":
await player.manager.voiceServerUpdate(packet.d);

View file

@ -2,11 +2,12 @@ const client = require("./client.js");
const logger = require("./logger.js");
const paginator = require("./pagination/pagination.js");
const fetch = require("node-fetch");
const fs = require("fs");
const moment = require("moment");
require("moment-duration-format");
const { Manager } = require("lavacord");
let nodes = require("../servers.json").lava;
let nodes;
exports.players = new Map();
@ -20,6 +21,8 @@ exports.status = false;
exports.connected = false;
exports.checkStatus = async () => {
const json = await fs.promises.readFile("./servers.json", { encoding: "utf8" });
nodes = JSON.parse(json).lava;
const newNodes = [];
for (const node of nodes) {
try {