feat(teams): grant each participant their game's divider role
Reuse the existing CS2/LoL divider roles as participant tags: sync_team_role now also adds the divider role for the member's team's game, and strips any other configured divider role (switched game / dropped out). Matched by ID against config.TEAM_DIVIDERS, so only the divider roles are ever touched. - TeamSyncResult gains divider_added / divider_removed; summary tallies both - /teamsync report and log line surface divider_assigned / divider_removed - tests: grants the game divider, swaps it on a game switch 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:
@@ -50,12 +50,15 @@ def register_economy_team_commands(
|
||||
summary = await sync_all_team_roles(guild, log)
|
||||
await interaction.followup.send(_format_summary(summary), ephemeral=True)
|
||||
log.info(
|
||||
"/teamsync - scanned=%d, assigned=%d, removed=%d, created=%d, positioned=%d, errors=%d",
|
||||
"/teamsync - scanned=%d, assigned=%d, removed=%d, created=%d, "
|
||||
"positioned=%d, divider_assigned=%d, divider_removed=%d, errors=%d",
|
||||
summary.scanned,
|
||||
summary.assigned,
|
||||
summary.removed,
|
||||
len(summary.created),
|
||||
summary.positioned,
|
||||
summary.divider_assigned,
|
||||
summary.divider_removed,
|
||||
len(summary.errors),
|
||||
)
|
||||
|
||||
@@ -74,6 +77,10 @@ def _format_summary(summary) -> str:
|
||||
lines.append(S.TEAMSYNC_UI["created"].format(roles=", ".join(unique)))
|
||||
if summary.positioned:
|
||||
lines.append(S.TEAMSYNC_UI["positioned"].format(count=summary.positioned))
|
||||
if summary.divider_assigned:
|
||||
lines.append(S.TEAMSYNC_UI["divider_assigned"].format(count=summary.divider_assigned))
|
||||
if summary.divider_removed:
|
||||
lines.append(S.TEAMSYNC_UI["divider_removed"].format(count=summary.divider_removed))
|
||||
if summary.errors:
|
||||
lines.append(S.TEAMSYNC_UI["errors"].format(count=len(summary.errors)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user