mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-23 21:52:45 -05:00
idk
This commit is contained in:
1 parent
93ab04691c
commit
5359498d12
8 files changed
+19
-15
No files matched your search
@@ -765,8 +765,10 @@ export class GatewayHandler {
|
||||
remix.voiceCache.updateUser({ guildId: guildId ?? prev?.guildId, userId, channelId, isBot: isBot === true });
|
||||
} else {
|
||||
const resolvedGuildId = guildId ?? prev?.guildId;
|
||||
remix.voiceCache.deleteHumanUser(userId, resolvedGuildId);
|
||||
remix.voiceCache.deleteBotUser(VoiceStateCache.userKey(resolvedGuildId, userId));
|
||||
if (resolvedGuildId) {
|
||||
remix.voiceCache.deleteHumanUser(userId, resolvedGuildId);
|
||||
remix.voiceCache.deleteBotUser(VoiceStateCache.userKey(resolvedGuildId, userId));
|
||||
}
|
||||
}
|
||||
|
||||
const isBotUser = isBot === true && userId === client.user?.id;
|
||||
@@ -814,9 +816,9 @@ export class GatewayHandler {
|
||||
|
||||
if (remix.dashboard?.enabled) {
|
||||
try {
|
||||
const userObj = data?.member?.user;
|
||||
let userObj = data?.member?.user;
|
||||
if (!userObj) {
|
||||
try { await client.users.fetch(userId).catch(() => {}); } catch (_) {}
|
||||
try { userObj = await client.users.fetch(userId).catch(() => null); } catch (_) {}
|
||||
}
|
||||
if (userObj) {
|
||||
const details = {
|
||||
@@ -975,7 +977,7 @@ export class GatewayHandler {
|
||||
}
|
||||
|
||||
const set = remix.settingsMgr.getServer(guildId);
|
||||
const raw = set.get("stay_247");
|
||||
const raw = set?.get("stay_247");
|
||||
if ((rekeyed || existingPlayer) && raw && raw !== "none") {
|
||||
const channels = Array.isArray(raw)
|
||||
? new Set(raw.map(id => String(id).replace(/\D/g, "")).filter(id => id.length >= 15))
|
||||
@@ -1181,7 +1183,6 @@ export class GatewayHandler {
|
||||
`[Rejoin] Track publication failed for channel ${cleanChannelId} (attempt ${attempt}/${maxRetries}) — ` +
|
||||
`retrying in ${backoffMs / 1000}s: ${errMsg}`
|
||||
);
|
||||
this._rejoinInProgress.delete(cleanChannelId);
|
||||
|
||||
await new Promise(resolve => setTimeout(resolve, backoffMs));
|
||||
|
||||
@@ -1547,7 +1548,7 @@ export class GatewayHandler {
|
||||
}
|
||||
|
||||
remix.settingsMgr.removeServer(guildId);
|
||||
remix._announcementChannelCache.delete(guildId);
|
||||
remix._announcementChannelCache?.delete(guildId);
|
||||
|
||||
if (!batchMode) logger.guild(`[GuildDelete] Cleanup complete for server ${guildId}.`);
|
||||
}
|
||||
|
||||
@@ -788,6 +788,7 @@ export class PlayerManager {
|
||||
const channel = this.commands.client?.channels?.get(cid);
|
||||
|
||||
if (!channel) {
|
||||
cb(null);
|
||||
return message.reply(mkEmbed(
|
||||
this._t(message, "responses.join.channelNotFound", { channel: cid })
|
||||
));
|
||||
@@ -796,10 +797,12 @@ export class PlayerManager {
|
||||
const isVoice = channel.type === 2;
|
||||
|
||||
if (!isVoice) {
|
||||
cb(null);
|
||||
return message.reply(mkEmbed(this._t(message, "responses._common.voiceChannelRequired")));
|
||||
}
|
||||
|
||||
if (!botHasVoicePermissions(this.commands?.client, cid)) {
|
||||
cb(null);
|
||||
return message.reply(mkEmbed(
|
||||
this._t(message, "responses.join.joinFailedPerms", { channel: `<#${cleanId(cid)}>` })
|
||||
));
|
||||
@@ -814,6 +817,7 @@ export class PlayerManager {
|
||||
return message.reply(mkEmbed(this._t(message, "responses.join.alreadyJoined", { channel: cid })));
|
||||
}
|
||||
if (this._pendingJoins.has(cleanChannelId)) {
|
||||
cb(null);
|
||||
return message.reply(mkEmbed(this._t(message, "responses.join.joining")));
|
||||
}
|
||||
this._pendingJoins.add(cleanChannelId);
|
||||
|
||||
+1
-1
@@ -218,7 +218,7 @@ export class RemoteSettingsManager extends EventEmitter {
|
||||
this._loadAttempts++;
|
||||
const delay = Math.min(1000 * Math.pow(2, this._loadAttempts - 1), 30_000);
|
||||
logger.error("[Settings] Init error (attempt", this._loadAttempts, "retrying in", delay + "ms):", res.error);
|
||||
return setTimeout(() => { this.load().catch(err => logger.error("[Settings] Retry load error:", err?.message ?? err)); }, delay);
|
||||
return new Promise((resolve) => { setTimeout(() => { this.load().then(resolve).catch(resolve); }, delay); });
|
||||
}
|
||||
this._loadAttempts = 0;
|
||||
res.results.forEach((r) => {
|
||||
|
||||
@@ -100,7 +100,6 @@ export class Utils {
|
||||
static chunk(array, size) {
|
||||
if (!Array.isArray(array)) return [];
|
||||
const chunkSize = Math.max(1, Math.floor(size));
|
||||
if (chunkSize < 1) return [];
|
||||
const chunks = [];
|
||||
for (let i = 0; i < array.length; i += chunkSize) {
|
||||
chunks.push(array.slice(i, i + chunkSize));
|
||||
|
||||
Reference in new issue
Block a user