Spaces:
Runtime error
Runtime error
Update index.js
Browse files
index.js
CHANGED
|
@@ -544,7 +544,6 @@ client.on('messageCreate', async (message) => {
|
|
| 544 |
|
| 545 |
}, 60000); // Check every minute
|
| 546 |
});
|
| 547 |
-
|
| 548 |
function addToCleanupQueue(guildId, channelId, messageId, type = 'poll') {
|
| 549 |
const config = storage.data.config[guildId] || {};
|
| 550 |
const hours = type === 'lineup' ? (config.lineupCleanupHours || 2) : (config.cleanupHours || 2);
|
|
@@ -644,7 +643,6 @@ client.on('messageCreate', async (message) => {
|
|
| 644 |
if (commandName === 'ping') {
|
| 645 |
const msg = await message.reply('Pinging...');
|
| 646 |
msg.edit(`Pong! Latency: ${msg.createdTimestamp - message.createdTimestamp}ms`);
|
| 647 |
-
return;
|
| 648 |
}
|
| 649 |
|
| 650 |
if (commandName === 'friendly') {
|
|
@@ -715,14 +713,11 @@ client.on('messageCreate', async (message) => {
|
|
| 715 |
lineup.clear();
|
| 716 |
saveLineup();
|
| 717 |
|
| 718 |
-
// Send NEW message with lineup (
|
| 719 |
const view = createLineupView(message.guildId);
|
| 720 |
-
|
| 721 |
-
activeLineupMessages.set(message.guildId, { channelId: message.channelId, messageId:
|
| 722 |
-
addToCleanupQueue(message.guildId, message.channelId,
|
| 723 |
-
|
| 724 |
-
// Update poll to show it's done
|
| 725 |
-
await msg.edit({ content: content + `\n\n✅ **Match is Ready!** Check the board below.` });
|
| 726 |
} else {
|
| 727 |
msg.edit({ content: content + `\n\n❌ Canceled: not enough players joined.` });
|
| 728 |
}
|
|
@@ -732,11 +727,6 @@ client.on('messageCreate', async (message) => {
|
|
| 732 |
storage.save('active_polls');
|
| 733 |
});
|
| 734 |
addToCleanupQueue(message.guildId, message.channelId, msg.id, 'poll');
|
| 735 |
-
return;
|
| 736 |
-
}
|
| 737 |
-
|
| 738 |
-
if (commandName === 'lineup') {
|
| 739 |
-
if (!roleStorage.isWhitelisted(message.guildId, message.member)) return sendNoPermission(message);
|
| 740 |
|
| 741 |
const mentionArg = args[0] ? args[0].toLowerCase().replace('@', '') : null;
|
| 742 |
const pingType = mentionArg === 'here' ? 'here' : 'everyone';
|
|
|
|
| 544 |
|
| 545 |
}, 60000); // Check every minute
|
| 546 |
});
|
|
|
|
| 547 |
function addToCleanupQueue(guildId, channelId, messageId, type = 'poll') {
|
| 548 |
const config = storage.data.config[guildId] || {};
|
| 549 |
const hours = type === 'lineup' ? (config.lineupCleanupHours || 2) : (config.cleanupHours || 2);
|
|
|
|
| 643 |
if (commandName === 'ping') {
|
| 644 |
const msg = await message.reply('Pinging...');
|
| 645 |
msg.edit(`Pong! Latency: ${msg.createdTimestamp - message.createdTimestamp}ms`);
|
|
|
|
| 646 |
}
|
| 647 |
|
| 648 |
if (commandName === 'friendly') {
|
|
|
|
| 713 |
lineup.clear();
|
| 714 |
saveLineup();
|
| 715 |
|
| 716 |
+
// Send NEW message with lineup (don't edit the poll message)
|
| 717 |
const view = createLineupView(message.guildId);
|
| 718 |
+
await msg.edit(view);
|
| 719 |
+
activeLineupMessages.set(message.guildId, { channelId: message.channelId, messageId: msg.id });
|
| 720 |
+
addToCleanupQueue(message.guildId, message.channelId, msg.id, 'lineup');
|
|
|
|
|
|
|
|
|
|
| 721 |
} else {
|
| 722 |
msg.edit({ content: content + `\n\n❌ Canceled: not enough players joined.` });
|
| 723 |
}
|
|
|
|
| 727 |
storage.save('active_polls');
|
| 728 |
});
|
| 729 |
addToCleanupQueue(message.guildId, message.channelId, msg.id, 'poll');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 730 |
|
| 731 |
const mentionArg = args[0] ? args[0].toLowerCase().replace('@', '') : null;
|
| 732 |
const pingType = mentionArg === 'here' ? 'here' : 'everyone';
|