forked from sass/tipibot
feat(teams): add Fienta as primary Discord->team source (sheet fallback)
The registration-log sheet only has in-game nicknames, so matching Discord
users to teams failed for ~10 of 40 teams. Fienta collects each competitor's
Discord username (+ sometimes user ID) and team name per ticket, giving a
reliable Discord-identity -> team mapping (validated: 201 usernames, 42 teams).
- core/fienta.py: token-auth client; fetch /events/{id}/tickets?attendees=true,
parse competitor/coach/substitute tickets into {username|id -> team} and
{team -> game}; exclude visitor/supporter/LAN/early-bird/waiting-list. No-op
when FIENTA_API_TOKEN/FIENTA_EVENT_ID unset.
- member_sync: resolve_team() tries Fienta (id, then username) then the sheet;
all_managed_team_names() and team_dividers() merge both sources.
- /teamsync + hourly task refresh Fienta alongside the sheet; enabled when
either source is configured.
- config + .env.example: FIENTA_API_TOKEN, FIENTA_EVENT_ID.
- tests: fienta parsing (game detection, inclusion rules, id/username mapping).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XPRsW4tazVtYi2jNzVQkre
This commit is contained in:
12
.env.example
12
.env.example
@@ -10,10 +10,18 @@ DISCORD_TOKEN=
|
||||
SHEET_ID=your-google-sheet-id-here
|
||||
|
||||
# Separate spreadsheet holding tournament team registrations (Team Name + lineup
|
||||
# of Discord usernames). Optional; drives /teamsync + hourly team-role sync on
|
||||
# the economy/community bot. Leave unset to disable team-role sync entirely.
|
||||
# of Discord usernames). Optional; a FALLBACK source for /teamsync + hourly
|
||||
# team-role sync on the economy/community bot. Leave unset to disable it.
|
||||
TEAM_SHEET_ID=
|
||||
|
||||
# Fienta ticketing - PRIMARY source for team-role sync. The registration collects
|
||||
# each competitor's Discord username + team name per ticket, so matching is by
|
||||
# real Discord handle (not game nickname). Get an API token from the Fienta admin
|
||||
# (organizer settings) and the event's numeric ID from its dashboard URL. Leave
|
||||
# unset to use only the sheet.
|
||||
FIENTA_API_TOKEN=
|
||||
FIENTA_EVENT_ID=
|
||||
|
||||
# Where each game's team roles get positioned in the role list. The key suffix
|
||||
# is matched against the section's title row in the sheet ("TipiLAN 2026 CS2
|
||||
# Registration Log") - every underscore-separated part must appear in it, so
|
||||
|
||||
Reference in New Issue
Block a user