Spaces:
Runtime error
Runtime error
Update index.js
Browse files
index.js
CHANGED
|
@@ -527,15 +527,37 @@ client.on('messageCreate', async (message) => {
|
|
| 527 |
saveLineup();
|
| 528 |
|
| 529 |
// Show lineup immediately without waiting for reactions
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 539 |
const sorted = Object.entries(storage.data.stats).sort((a, b) => (b[1].matches || 0) - (a[1].matches || 0)).slice(0, 10);
|
| 540 |
let text = sorted.map(([id, data], i) => `**#${i + 1}** <@${id}> — \`${data.matches || 0}\` matches | ⭐ \`${data.mvps || 0}\` MVPs`).join('\n');
|
| 541 |
await message.reply({ embeds: [UI.createEmbed("🏆 Most Active Players", text || "No data yet.")] });
|
|
|
|
| 527 |
saveLineup();
|
| 528 |
|
| 529 |
// Show lineup immediately without waiting for reactions
|
| 530 |
+
console.log(`[DEBUG] LINEUP-MSG: guild=${message.guildId} pingType=${pingType} owner=${message.author?.id || 'unknown'}`);
|
| 531 |
+
const view = createLineupView(message.guildId);
|
| 532 |
+
const msg = await message.channel.send(view);
|
| 533 |
+
activeLineupMessages.set(message.guildId, { channelId: message.channelId, messageId: msg.id });
|
| 534 |
+
addToCleanupQueue(message.guildId, message.channelId, msg.id, 'lineup');
|
| 535 |
+
return;
|
| 536 |
+
}
|
| 537 |
+
|
| 538 |
+
if (commandName === 'scrimlineup') {
|
| 539 |
+
if (!roleStorage.isWhitelisted(message.guildId, message.member)) return sendNoPermission(message);
|
| 540 |
+
|
| 541 |
+
const mentionArg = args[0] ? args[0].toLowerCase().replace('@', '') : null;
|
| 542 |
+
const pingType = mentionArg === 'here' ? 'here' : 'everyone';
|
| 543 |
+
guildPingType.set(message.guildId, pingType);
|
| 544 |
+
|
| 545 |
+
lineupOwners.set(message.guildId, message.author.id);
|
| 546 |
+
saveLineup();
|
| 547 |
+
|
| 548 |
+
const lineup = getGuildLineup(message.guildId);
|
| 549 |
+
lineup.clear();
|
| 550 |
+
saveLineup();
|
| 551 |
+
|
| 552 |
+
console.log(`[DEBUG] SCRIMLINEUP-MSG: guild=${message.guildId} pingType=${pingType} owner=${message.author?.id || 'unknown'}`);
|
| 553 |
+
const view = createScrimLineupView(message.guildId);
|
| 554 |
+
const msg = await message.channel.send(view);
|
| 555 |
+
activeLineupMessages.set(message.guildId, { channelId: message.channelId, messageId: msg.id });
|
| 556 |
+
addToCleanupQueue(message.guildId, message.channelId, msg.id, 'lineup');
|
| 557 |
+
return;
|
| 558 |
+
}
|
| 559 |
+
|
| 560 |
+
if (commandName === 'top') {
|
| 561 |
const sorted = Object.entries(storage.data.stats).sort((a, b) => (b[1].matches || 0) - (a[1].matches || 0)).slice(0, 10);
|
| 562 |
let text = sorted.map(([id, data], i) => `**#${i + 1}** <@${id}> — \`${data.matches || 0}\` matches | ⭐ \`${data.mvps || 0}\` MVPs`).join('\n');
|
| 563 |
await message.reply({ embeds: [UI.createEmbed("🏆 Most Active Players", text || "No data yet.")] });
|