fix: resolve bugs in voice, filter, dashboard, and stats handling

- Fix filter command using stale track reference instead of current queue track

- Fix playnext null check before editing status message

- Fix join command using raw channel ID before cleaning it

- Fix GatewayHandler passing wrong isBot flag in voice state cache

- Fix Dashboard shared server filtering (was returning empty, now filters correctly)

- Fix avatar fallback using discriminator (deprecated) → use user ID instead

- Refactor Player.mjs: extract ConnectionState/LKRoomEvent to FluxerRevoice constants

- Refactor Player.mjs: replace local formatMsHelper with Utils.prettifyMS

- Add Logger.guild() method; use it in GatewayHandler instead of logger.info()

- Remove rbl-stats module from modules.json

- Remove unused empty event listeners in PlayerManager

- Remove unused CRITICAL_PERMISSIONS import from GatewayHandler
This commit is contained in:
NoLogicAlan committed 2026-05-25 19:22:20 +03:00
1 parent 58464e6862
commit b581722c46
19 files changed
+45 -92

No files matched your search

+1 -2
View File
@@ -9,7 +9,6 @@ export const command = new CommandBuilder()
.addAliases("ap");
export async function run(msg, data) {
const prefix = this.handler?.getPrefix?.(msg.message?.guildId) ?? "%";
const p = await this.getPlayer(msg, true, true, false);
if (!p) return;
@@ -19,7 +18,7 @@ export async function run(msg, data) {
if (!p._autoplayHandler) {
p._autoplayHandler = async () => {
if (!p._autoplay) return;
if (p.queue?.getCurrent() || !p.queue?.isEmpty()) return;
if (p.queue?.getCurrent() && !p.queue?.isEmpty()) return;
const lastTrack = p._lastPlayedTrack;
if (!lastTrack) return;
-9
View File
@@ -79,15 +79,6 @@ export async function run(msg, data) {
{
let groupJson = "";
let groupStart = 0;
const flushGroup = () => {
if (!groupJson) return;
const codeBlock = "```json\n" + groupJson + "\n```";
pages.push(codeBlock.slice(0, MAX_DESC));
groupJson = "";
groupStart = i;
};
let i = 0;
for (i = 0; i < servers.length; i++) {
+1 -1
View File
@@ -403,7 +403,7 @@ export async function run(msg) {
await menuMsg.edit({ embeds: [errEmbed] }).catch(() => {});
await Utils.sleep(1500);
await menuMsg.edit({
embeds: [buildPageEmbed(this.t.bind(this), msg, page, activeKeys, track)]
embeds: [buildPageEmbed(this.t.bind(this), msg, page, activeKeys, player.queue.getCurrent())]
}).catch(() => {});
return;
}
+1 -1
View File
@@ -26,7 +26,7 @@ export async function run(msg, data) {
const cid = cleanId(data.get("channelId").value);
const targetChannel = this.client.channels.get(cid);
if (!targetChannel) return msg.reply(embed(this.t(msg, "responses.forceleave.channelNotFound")));
if (cleanId(msg.message.guildId) !== cleanId(targetChannel.guildId))
if (cleanId(msg.message?.guildId) !== cleanId(targetChannel.guildId))
return msg.reply(embed(this.t(msg, "responses.forceleave.wrongServer")));
const p = this.players.playerMap.get(cid)
?? [...this.players.playerMap.values()].find((player) => cleanId(player?._channelId) === cid);
+2 -2
View File
@@ -19,13 +19,13 @@ function cleanId(value) {
}
export async function joinChannel(message, cid, cb = () => {}, ecb = () => {}) {
if (!this.client.channels.has(cid)) {
const cleanChannelId = cleanId(cid);
if (!this.client.channels.has(cleanChannelId)) {
ecb();
const embed = new EmbedBuilder().setColor(getGlobalColor())
.setDescription(this.t(message, "responses.join.channelNotFound", { channel: cid }));
return message.reply({ embeds: [embed] });
}
const cleanChannelId = cleanId(cid);
const existing = this.players.playerMap.get(cleanChannelId)
?? [...this.players.playerMap.values()].find((player) => cleanId(player?._channelId) === cleanChannelId);
if (existing) {
+2 -2
View File
@@ -991,7 +991,7 @@ export async function run(msg, data) {
fields.push({ name: "Listeners", value: Utils.formatNumber(info.stats?.listeners ?? 0), inline: true });
fields.push({ name: "Global Plays", value: Utils.formatNumber(info.stats?.playcount ?? 0), inline: true });
if (info.userplaycount !== null && user) {
if (info.userplaycount != null && user) {
fields.push({ name: "Your Plays", value: Utils.formatNumber(info.userplaycount), inline: true });
}
@@ -1085,7 +1085,7 @@ export async function run(msg, data) {
fields.push({ name: "Artist", value: info.artist, inline: true });
}
if (info.userplaycount !== null && user) {
if (info.userplaycount != null && user) {
fields.push({ name: "Your Plays", value: Utils.formatNumber(info.userplaycount), inline: true });
}
+1 -1
View File
@@ -294,7 +294,7 @@ export async function run(msg) {
try {
switch (control.action) {
case "previous":
reply = this.t(msg, "responses.player.previousNotImplemented");
reply = "Previous track is not available yet.";
break;
case "resume":
+1 -1
View File
@@ -55,6 +55,6 @@ export async function run(message, data) {
const messages = p.playFirst(query, provider);
messages.on("message", d => {
const embed = new EmbedBuilder().setColor(getGlobalColor()).setDescription(d);
statusMsg.edit({ embeds: [embed] }).catch(() => {});
if (statusMsg) statusMsg.edit({ embeds: [embed] }).catch(() => {});
});
}
-4
View File
@@ -68,7 +68,6 @@ function getUserCount(client) {
function getLivePlayerCount(playerMap) {
let live = 0;
const seenGuilds = new Set();
for (const [mapKey, player] of playerMap ?? []) {
if (!player || player._destroyed || player.leaving) continue;
@@ -87,9 +86,6 @@ function getLivePlayerCount(playerMap) {
}
live++;
const guildId = String(player._guildId ?? "").replace(/\D/g, "");
if (guildId) seenGuilds.add(guildId);
}
return live;