mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
cleannnn
This commit is contained in:
1 parent
05fb38aabd
commit
bc1fe82919
43 files changed
+122
-1784
No files matched your search
@@ -16,10 +16,8 @@ export async function run(msg, data) {
|
||||
|
||||
const channelCounts = new Map();
|
||||
|
||||
// Use VoiceStateCache API for both humans and bots
|
||||
const cache = this.voiceCache ?? this.observedVoiceUsers;
|
||||
if (cache) {
|
||||
// Humans
|
||||
if (typeof cache.iterateHumanUsers === "function") {
|
||||
for (const [, state] of cache.iterateHumanUsers()) {
|
||||
if (state.guildId !== guild.id) continue;
|
||||
@@ -31,7 +29,6 @@ export async function run(msg, data) {
|
||||
channelCounts.set(state.channelId, (channelCounts.get(state.channelId) ?? 0) + 1);
|
||||
}
|
||||
}
|
||||
// Bots
|
||||
if (typeof cache.iterateBotUsers === "function") {
|
||||
for (const [, state] of cache.iterateBotUsers()) {
|
||||
if (state.guildId !== guild.id) continue;
|
||||
@@ -67,7 +64,6 @@ export async function run(msg, data) {
|
||||
for (const [channelId, total] of channelCounts) {
|
||||
const name = await getChannelName(channelId);
|
||||
const entry = this.t(msg, "responses.test.channelEntry", { name, count: total });
|
||||
// Guard against 4096-char embed description limit
|
||||
if (desc.length + entry.length > 4080) break;
|
||||
desc += entry;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user