This commit is contained in:
NoLogicAlan committed 2026-05-09 16:40:25 +03:00
1 parent 1227e897c9
commit 3f5c395986
4 files changed
+86 -10

No files matched your search

+24 -3
View File
@@ -18,18 +18,39 @@ export function run(msg, data) {
case "voice": {
const servers = [...this.players.playerMap.entries()].map(([cid, s]) => {
const channel = this.client.channels.get(cid);
const conn = s.connection;
const room = conn?.room;
const roomState = room?.state ?? "no-room";
const hasMediaPlayer = !!s._mediaPlayer && !s._mediaPlayer?.destroyed;
return {
name: channel?.name ?? "unknown",
id: channel?.id ?? cid,
status: s.connection?.state?.status ?? "unknown",
channelId: s._channelId ?? cid,
guildId: s._guildId ?? "unknown",
guildname: channel?.guild?.name ?? "unknown",
guildid: channel?.guildId ?? "unknown"
conn: conn ? "yes" : "null",
roomState,
mediaPlayer: hasMediaPlayer ? "alive" : (s._mediaPlayer?.destroyed ? "destroyed" : "none"),
destroyed: s._destroyed ?? false,
leaving: s.leaving ?? false,
joining: s._isJoining ?? false,
recovering: s._isRecovering ?? false,
paused: s._paused ?? false,
hasQueue: !!(s.queue?.getCurrent() || !s.queue?.isEmpty()),
home247: s._home247Channel ?? null,
};
});
const pending = [...(this.players._pendingJoins ?? [])];
const summary = {
playerMapSize: this.players.playerMap.size,
livePlayers: servers.filter(s => s.conn === "yes" && !s.destroyed && !s.leaving).length,
pendingJoins: pending.length,
pendingChannels: pending,
};
const embed = new EmbedBuilder()
.setColor(getGlobalColor())
.setTitle(this.t(msg, "responses.debug.voiceTitle"))
.setDescription("```json\n" + JSON.stringify(servers, null, 2) + "\n```")
.setDescription("```json\n" + JSON.stringify({ summary, servers }, null, 2) + "\n```")
;
msg.reply({ embeds: [embed] });
break;