Spaces:
Runtime error
Runtime error
Update index.js
Browse files40 unmodified lines4142434445464748492635 unmodified lines26852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272035 unmodified lines27562757275827592760276127621 unmodified line27642765276627672768276927702771277240 unmodified linesconst { createLineupAttachment } = require('./lineupRenderer');const { createProfileAttachment } = require('./profileRenderer');const { TACTICS, createTacticAttachment } = require('./tacticRenderer');global.createLineupAttachment = createLineupAttachment;global.createProfileAttachment = createProfileAttachment;global.createTacticAttachment = createTacticAttachment;global.TACTICS = TACTICS;global.saveLineup = saveLineup;console.log(">>> [BOOT] Graphics Renderers & Persistence loaded.");2635 unmodified linesconst subs = players.slice(1);let line = `🟩 **${resolvedLabel}** ➔ <@${starter}>`;if (subs.length > 0) {line += ` (Substitute: ` + subs.map(p => `<@${p}>`).join(', ') + `)`;}text += line + "\n\n";} else {text += `⬛ **${resolvedLabel}** ➔ *Open*\n\n`;}}let textRotated = "";const reversedFormation = [...formation].reverse();for (const [posKey, posLabel] of reversedFormation) {const players = lineup.get(posKey) || [];const resolvedLabel = resolveEmojis(posLabel, guildId);if (players.length > 0) {const starter = players[0];const subs = players.slice(1);let line = `🟩 **${resolvedLabel}** ➔ <@${starter}>`;if (subs.length > 0) {line += ` (Substitute: ` + subs.map(p => `<@${p}>`).join(', ') + `)`;}textRotated += line + "\n\n";} else {textRotated += `⬛ **${resolvedLabel}** ➔ *Open*\n\n`;}}const embed = UI.createEmbed(`⚽ SCRIMMAGE LINEUP — ${resolveEmojis(formDisplayName, guildId)}`, text, UI.colors.primary);embed.setFooter({ text: "Left: Team A | Right: Team B (Rotated) | Click positions to join/leave" });const embedRotated = UI.createEmbed(`🔄 TEAM B (ROTATED)`, textRotated, UI.colors.success);const rows = [];35 unmodified linesif (currentPosCount > 0) rows.push(currentRow);rows.push(new ActionRowBuilder().addComponents(new ButtonBuilder().setCustomId('lineup_done').setLabel('Show Final Image').setStyle(ButtonStyle.Success).setEmoji("🖼️"),new ButtonBuilder().setCustomId('open_custom_lineup_modal').setLabel('Custom / Other Sizes').setStyle(ButtonStyle.Primary).setEmoji("🛠️"),new ButtonBuilder().setCustomId('lineup_clear').setLabel('Clear Board').setStyle(ButtonStyle.Danger)));1 unmodified lineconst pingType = guildPingType.get(guildId) || 'everyone';const pingMention = pingType === 'here' ? '@here' : '@everyone';const mentionParse = ['everyone'];const content = `${pingMention}\n**🔥 SCRIMMAGE LINEUP SESSION ACTIVE!**\n*Two teams facing each other!*`;return { content, embeds: [embed, embedRotated], components: rows, allowedMentions: { parse: mentionParse } };}function createManagerEditor(guildId, client) {40 unmodified lines41424344454647484950512635 unmodified lines268726882689269026912692269326942695269626972698269927002701270235 unmodified lines27382739274027412742274327441 unmodified line27462747274827492750275127522753275440 unmodified linesconst { createLineupAttachment } = require('./lineupRenderer');const { createProfileAttachment } = require('./profileRenderer');const { TACTICS, createTacticAttachment } = require('./tacticRenderer');const { createScrimmageAttachment } = require('./scrimRenderer');global.createLineupAttachment = createLineupAttachment;global.createProfileAttachment = createProfileAttachment;global.createTacticAttachment = createTacticAttachment;global.createScrimmageAttachment = createScrimmageAttachment;global.TACTICS = TACTICS;global.saveLineup = saveLineup;console.log(">>> [BOOT] Graphics Renderers & Persistence loaded.");2635 unmodified linesconst subs = players.slice(1);let line = `🟩 **${resolvedLabel}** ➔ <@${starter}>`;if (subs.length > 0) {line += ` (Sub: ` + subs.map(p => `<@${p}>`).join(', ') + `)`;}text += line + "\n";} else {text += `⬛ **${resolvedLabel}** ➔ *Open*\n`;}}const embed = UI.createEmbed(`⚽ SCRIMMAGE — TEAM A: ${resolveEmojis(formDisplayName, guildId)}`, text, UI.colors.primary);embed.setFooter({ text: "Click positions to join Team A | Show Final Image for full scrimmage view" });const rows = [];35 unmodified linesif (currentPosCount > 0) rows.push(currentRow);rows.push(new ActionRowBuilder().addComponents(new ButtonBuilder().setCustomId('lineup_done').setLabel('Show Scrimmage Image').setStyle(ButtonStyle.Success).setEmoji("🖼️"),new ButtonBuilder().setCustomId('open_custom_lineup_modal').setLabel('Custom / Other Sizes').setStyle(ButtonStyle.Primary).setEmoji("🛠️"),new ButtonBuilder().setCustomId('lineup_clear').setLabel('Clear Board').setStyle(ButtonStyle.Danger)));1 unmodified lineconst pingType = guildPingType.get(guildId) || 'everyone';const pingMention = pingType === 'here' ? '@here' : '@everyone';const mentionParse = ['everyone'];const content = `${pingMention}\n**🔥 SCRIMMAGE LINEUP SESSION ACTIVE!**\n*Two teams will face each other!*`;return { content, embeds: [embed], components: rows, allowedMentions: { parse: mentionParse } };}function createManagerEditor(guildId, client) {
index.js+10-28