Make soundreload more useful
This commit is contained in:
parent
2499fb2a3b
commit
f0c685d8c4
2 changed files with 5 additions and 1 deletions
|
@ -2,6 +2,7 @@ const player = require("../utils/soundplayer.js");
|
||||||
|
|
||||||
// run when a raw packet is sent, used for sending data to lavalink
|
// run when a raw packet is sent, used for sending data to lavalink
|
||||||
module.exports = async (packet) => {
|
module.exports = async (packet) => {
|
||||||
|
if (!player.manager) return;
|
||||||
switch (packet.t) {
|
switch (packet.t) {
|
||||||
case "VOICE_SERVER_UPDATE":
|
case "VOICE_SERVER_UPDATE":
|
||||||
await player.manager.voiceServerUpdate(packet.d);
|
await player.manager.voiceServerUpdate(packet.d);
|
||||||
|
|
|
@ -2,11 +2,12 @@ const client = require("./client.js");
|
||||||
const logger = require("./logger.js");
|
const logger = require("./logger.js");
|
||||||
const paginator = require("./pagination/pagination.js");
|
const paginator = require("./pagination/pagination.js");
|
||||||
const fetch = require("node-fetch");
|
const fetch = require("node-fetch");
|
||||||
|
const fs = require("fs");
|
||||||
const moment = require("moment");
|
const moment = require("moment");
|
||||||
require("moment-duration-format");
|
require("moment-duration-format");
|
||||||
const { Manager } = require("lavacord");
|
const { Manager } = require("lavacord");
|
||||||
|
|
||||||
let nodes = require("../servers.json").lava;
|
let nodes;
|
||||||
|
|
||||||
exports.players = new Map();
|
exports.players = new Map();
|
||||||
|
|
||||||
|
@ -20,6 +21,8 @@ exports.status = false;
|
||||||
exports.connected = false;
|
exports.connected = false;
|
||||||
|
|
||||||
exports.checkStatus = async () => {
|
exports.checkStatus = async () => {
|
||||||
|
const json = await fs.promises.readFile("./servers.json", { encoding: "utf8" });
|
||||||
|
nodes = JSON.parse(json).lava;
|
||||||
const newNodes = [];
|
const newNodes = [];
|
||||||
for (const node of nodes) {
|
for (const node of nodes) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue