diff --git a/core/member_sync.py b/core/member_sync.py index 4c096de..a579fa4 100644 --- a/core/member_sync.py +++ b/core/member_sync.py @@ -480,6 +480,16 @@ async def apply_team_role_positions( return 0, errors except discord.HTTPException as e: errors.append(f"Tiimirollide järjestamine ebaõnnestus: {e}") + # 50013 here despite Manage Roles usually means a role in the batch sits + # at/above the bot's top role. Log the batch vs bot_top to pinpoint it. + log.warning( + "edit_role_positions failed (%s); bot_top=%d; batch=%s", + e, bot_top, + sorted( + ((r.name, r.position, target) for r, target in positions.items()), + key=lambda x: -x[1], + ), + ) return 0, errors log.info("Positioned %d team role(s) under their dividers", len(positions)) return len(positions), errors