Remove "requires" command field, overhaul Lavalink connection, fix message objects not being properly sent
This commit is contained in:
parent
a274acd00c
commit
e5fd71b388
10 changed files with 51 additions and 84 deletions
|
@ -1,5 +1,5 @@
|
|||
import Command from "../../classes/command.js";
|
||||
import { checkStatus, reload } from "../../utils/soundplayer.js";
|
||||
import { reload } from "../../utils/soundplayer.js";
|
||||
|
||||
class SoundReloadCommand extends Command {
|
||||
async run() {
|
||||
|
@ -9,17 +9,16 @@ class SoundReloadCommand extends Command {
|
|||
return "Only the bot owner can reload Lavalink!";
|
||||
}
|
||||
await this.acknowledge();
|
||||
const soundStatus = await checkStatus();
|
||||
if (!soundStatus) {
|
||||
const length = reload();
|
||||
if (process.env.PM2_USAGE) {
|
||||
process.send({
|
||||
type: "process:msg",
|
||||
data: {
|
||||
type: "soundreload"
|
||||
}
|
||||
});
|
||||
}
|
||||
const length = await reload();
|
||||
if (process.env.PM2_USAGE) {
|
||||
process.send({
|
||||
type: "process:msg",
|
||||
data: {
|
||||
type: "soundreload"
|
||||
}
|
||||
});
|
||||
}
|
||||
if (length) {
|
||||
return `Successfully connected to ${length} Lavalink node(s).`;
|
||||
} else {
|
||||
return "I couldn't connect to any Lavalink nodes!";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue