mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
great and not great
This commit is contained in:
1 parent
ed622ee453
commit
a78edeaa9a
4 files changed
+313
-238
No files matched your search
+13
-8
@@ -372,18 +372,16 @@ export class PlayerManager {
|
||||
const seedObserved = (channelId) => {
|
||||
const cleanChannelId = cleanId(channelId);
|
||||
if (!cleanChannelId) return null;
|
||||
if (!this.observedVoiceUsers?.has(userId)) {
|
||||
const current = this.observedVoiceUsers?.get?.(userId) ?? null;
|
||||
if (
|
||||
cleanId(current?.guildId) !== cleanGuild ||
|
||||
cleanId(current?.channelId) !== cleanChannelId
|
||||
) {
|
||||
this.observedVoiceUsers?.set(userId, { channelId: cleanChannelId, guildId: cleanGuild });
|
||||
}
|
||||
return cleanId(this.observedVoiceUsers?.get(userId)?.channelId) || cleanChannelId;
|
||||
return cleanChannelId;
|
||||
};
|
||||
|
||||
const observed = this.observedVoiceUsers?.get?.(userId);
|
||||
if (cleanId(observed?.guildId) === cleanGuild) {
|
||||
const observedChannelId = cleanId(observed?.channelId);
|
||||
if (observedChannelId) return observedChannelId;
|
||||
}
|
||||
|
||||
try {
|
||||
const vm = getVoiceManager(this.commands.client);
|
||||
const voiceChannelId = vm?.getVoiceChannelId?.(guildId, userId);
|
||||
@@ -479,6 +477,13 @@ export class PlayerManager {
|
||||
} catch (_) {}
|
||||
}
|
||||
}
|
||||
|
||||
const observed = this.observedVoiceUsers?.get?.(userId);
|
||||
if (cleanId(observed?.guildId) === cleanGuild) {
|
||||
const observedChannelId = cleanId(observed?.channelId);
|
||||
if (observedChannelId) return observedChannelId;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user