Match members by Discord username against the lineup nicknames in the separate registration spreadsheet (TEAM_SHEET_ID) and give each their team's role. One team per person: switching teams removes the old team role, and a team with no Discord role yet is auto-created. Only role names present in the sheet are ever touched, so organisation/field/base roles are never at risk; the feature is a no-op when TEAM_SHEET_ID is unset. The sheet is not a single table (merged rows, stacked CS2/LoL sections with different layouts), so it is parsed via raw-row scanning rather than get_all_records. Citizenship markers like "(EST)" are used only as player delimiters and discarded. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
15 KiB
15 KiB