mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-23 21:52:45 -05:00
fixed
This commit is contained in:
1 parent
5a29545d41
commit
93ab04691c
4 files changed
+5
-4
No files matched your search
@@ -144,7 +144,7 @@ function remove247ChannelMode(set, channelId, currentChannels) {
|
||||
if (!modes || typeof modes !== "object" || Array.isArray(modes)) return;
|
||||
delete modes[channelId];
|
||||
set.set("stay_247_modes", modes);
|
||||
if (currentChannels.size === 0) {
|
||||
if (!currentChannels || currentChannels.size === 0) {
|
||||
set.set("stay_247_mode", "off");
|
||||
} else {
|
||||
const firstChannel = [...currentChannels][0];
|
||||
|
||||
+1
-1
@@ -167,7 +167,7 @@ export async function run(message) {
|
||||
const lastfmEnabled = lastfm?.enabled ?? false;
|
||||
|
||||
const shared = {
|
||||
guildCount: cachedGuildCount ?? this.client.guilds.size,
|
||||
guildCount: cachedGuildCount ?? this.client.guilds?.size ?? 0,
|
||||
playerCount: getLivePlayerCount(this.players.playerMap),
|
||||
scrobbleCount: 0,
|
||||
linkedUsers: 0,
|
||||
|
||||
@@ -1401,10 +1401,11 @@ export class GatewayHandler {
|
||||
try {
|
||||
const set = remix.settingsMgr.getServer(guildId);
|
||||
if (set) {
|
||||
remove247ChannelMode(set, channelId);
|
||||
const raw = set.get("stay_247");
|
||||
const arr = Array.isArray(raw) ? raw : raw ? [raw] : [];
|
||||
const filtered = arr.filter(id => id && id !== "none" && String(id).replace(/\D/g, "") !== channelId);
|
||||
const remainingSet = new Set(filtered.map(id => String(id).replace(/\D/g, "")));
|
||||
remove247ChannelMode(set, channelId, remainingSet);
|
||||
set.set("stay_247", filtered.length > 0 ? filtered : "none");
|
||||
}
|
||||
} catch (cleanupErr) {
|
||||
|
||||
@@ -58,7 +58,7 @@ export function remove247ChannelMode(set, channelId, currentChannels) {
|
||||
if (!modes || typeof modes !== "object" || Array.isArray(modes)) return;
|
||||
delete modes[channelId];
|
||||
set.set("stay_247_modes", modes);
|
||||
if (currentChannels.size === 0) {
|
||||
if (!currentChannels || currentChannels.size === 0) {
|
||||
set.set("stay_247_mode", "off");
|
||||
} else {
|
||||
const firstChannel = [...currentChannels][0];
|
||||
|
||||
Reference in new issue
Block a user