Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/advent259141/astrbot_self_manager_skill --skill conversation-manager명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | conversation-manager |
| description | 管理对话记录的列出、清除、切换和删除操作 |
| version | 2.0.0 |
| author | AstrBot Community |
| requires_admin | true |
| requires_computer_use | true |
管理 AI 对话历史记录。
async def list_conversations(context, umo: str):
try:
conversations = await context.conversation_mgr.list_conversations(umo)
if not conversations:
return "当前没有对话记录。"
lines = ["💬 对话列表:\n"]
for i, conv in enumerate(conversations, 1):
conv_id = conv.get("id", "")
title = conv.get("title", f"对话 {i}")
msg_count = conv.get("message_count", 0)
is_current = conv.get("is_current", False)
marker = "👉 " if is_current else " "
lines.append(f"{marker}{i}. **{title}** ({msg_count} 条消息) [ID: {conv_id}]")
return "\n".join(lines)
except Exception as e:
return f"❌ 列出对话失败:{e}"
event = globals().get('event')
if not event.is_admin():
print("❌ 错误:仅管理员可用")
import sys; sys.exit(1)
context = globals().get('context')
umo = event.unified_msg_origin
result = await list_conversations(context, umo)
print(result)
async def clear_conversation(context, umo: str):
try:
await context.conversation_mgr.clear_conversation(umo)
return "✅ 当前对话已清除。"
except Exception as e:
return f"❌ 清除失败:{e}"
result = await clear_conversation(context, umo)
print(result)
async def switch_conversation(context, umo: str, conversation_id: str):
try:
success = await context.conversation_mgr.switch_conversation(umo, conversation_id)
if success:
return f"✅ 已切换到对话「{conversation_id}」。"
else:
return f"❌ 切换失败:对话不存在。"
except Exception as e:
return f"❌ 切换失败:{e}"
# 从用户输入提取对话 ID
result = await switch_conversation(context, umo, conversation_id="<对话ID>")
print(result)
async def delete_conversation(context, umo: str, conversation_id: str):
try:
await context.conversation_mgr.delete_conversation(umo, conversation_id)
return f"✅ 对话「{conversation_id}」已删除。"
except Exception as e:
return f"❌ 删除失败:{e}"
result = await delete_conversation(context, umo, conversation_id="<对话ID>")
print(result)