格式化角色列表
(roles_result: Dict)
| 246 | def format_role_list(roles_result: Dict) -> str: |
| 247 | """格式化角色列表""" |
| 248 | lines = [] |
| 249 | lines.append("=" * 60) |
| 250 | lines.append("Role List") |
| 251 | lines.append("=" * 60) |
| 252 | lines.append("") |
| 253 | |
| 254 | roles = roles_result.get("roles", []) |
| 255 | |
| 256 | if not roles: |
| 257 | lines.append("(no roles yet)") |
| 258 | else: |
| 259 | for role in roles: |
| 260 | marker = "[CURRENT]" if role["is_current"] else " " |
| 261 | lines.append(f"{marker} {role['name']} - {role.get('description', 'no description')}") |
| 262 | |
| 263 | lines.append("") |
| 264 | lines.append("=" * 60) |
| 265 | lines.append("Commands:") |
| 266 | lines.append(' Create: "create role roleB, direction: ..."') |
| 267 | lines.append(' Switch: "switch to roleB"') |
| 268 | lines.append(' Delete: "delete role roleA"') |
| 269 | lines.append("=" * 60) |
| 270 | |
| 271 | return "\n".join(lines) |
| 272 | |
| 273 | |
| 274 | def bind_chat_id(role_name: str, feishu_chat_id: str) -> Dict[str, Any]: |
| 275 | """ |
| 276 | 绑定飞书群 ID 到角色 |
| 277 |
no test coverage detected