()
| 4 | |
| 5 | class 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"]; |
nothing calls this directly
no test coverage detected