MCPcopy Create free account
hub / github.com/esmBot/esmBot / run

Method run

commands/general/soundreload.js:6–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5class SoundReloadCommand extends Command {
6 async run() {
7 const owners = process.env.OWNER?.split(",") ?? [];
8 if (!owners.includes(this.author.id)) {
9 this.success = false;
10 return this.getString("commands.responses.soundreload.botOwnerOnly");
11 }
12 await this.acknowledge();
13 const length = await reload(this.client);
14 if (process.env.CLUSTER_TYPE) {
15 process.send?.({
16 type: "process:msg",
17 data: {
18 type: "soundreload",
19 from: process.env.pm_id,
20 },
21 });
22 }
23 if (length) {
24 return this.getString("commands.responses.soundreload.failed", { params: { length: length.toString() } });
25 }
26 return this.getString("commands.responses.soundreload.failed");
27 }
28
29 static description = "Attempts to reconnect to all available Lavalink nodes";
30 static aliases = ["lava", "lavalink", "lavaconnect", "soundconnect"];

Callers

nothing calls this directly

Calls 3

reloadFunction · 0.85
getStringMethod · 0.80
acknowledgeMethod · 0.80

Tested by

no test coverage detected