Spaces:
Runtime error
Runtime error
Update index.js
Browse files638 unmodified lines639640641642643644645646647648649638 unmodified lineslineup.clear();saveLineup();// Always send the final lineup as a new message (not editing the friendly poll text)const view = createLineupView(message.guildId);const lineupMsg = await message.channel.send(view);activeLineupMessages.set(message.guildId, { channelId: message.channelId, messageId: lineupMsg.id });addToCleanupQueue(message.guildId, message.channelId, lineupMsg.id, 'lineup');} else {// If not ready, inform via the poll message onlyawait msg.edit({ content: content + `\n\n❌ Canceled: not enough players joined.` });638 unmodified lines639640641642643644645646647648649650651652653654655656657658659660661662663664665666667638 unmodified lineslineup.clear();saveLineup();// Produce final lineup as a single message, reusing existing lineup message if presentconst view = createLineupView(message.guildId);let lineupMsg = null;const existingInfo = activeLineupMessages.get(message.guildId);if (existingInfo) {try {const ch = await client.channels.fetch(existingInfo.channelId).catch(() => null);if (ch) {const existing = await ch.messages.fetch(existingInfo.messageId).catch(() => null);if (existing) {await existing.edit(view).catch(() => {});lineupMsg = existing;}}} catch {}}if (!lineupMsg) {lineupMsg = await message.channel.send(view);}activeLineupMessages.set(message.guildId, { channelId: message.channelId, messageId: lineupMsg.id });addToCleanupQueue(message.guildId, message.channelId, lineupMsg.id, 'lineup');// Remove the poll message to ensure only a single lineup message remainstry { await msg.delete().catch(() => { }); } catch { /* ignore */ }} else {// If not ready, inform via the poll message onlyawait msg.edit({ content: content + `\n\n❌ Canceled: not enough players joined.` });
index.js+20-2