onebot-group-admin

QQ 群管理操作,通过 OneBot 11 API 实现群名修改、群公告、禁言、踢人、设置管理员、全员禁言等功能。当用户需要在 QQ 群中执行管理操作时使用,如修改群名、发公告、禁言某人、踢人、设置管理员等。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "onebot-group-admin" with this command: npx skills add yinwuzhe/test-1

OneBot 群管理

通过 scripts/onebot-action.js 调用 napcat 的 OneBot 11 API 执行群管理操作。

脚本路径

~/.openclaw/workspace/skills/onebot-group-admin/scripts/onebot-action.js

用法

node <脚本路径> <action> [key=value ...]

参数中的数字会自动转为整数,字符串不需要引号。含空格的值用双引号包裹。

常用操作

修改群名

node onebot-action.js set_group_name group_id=<群号> group_name="新群名"

发送群公告

node onebot-action.js _send_group_notice group_id=<群号> content="公告内容"

⚠️ 注意是 _send_group_notice(带下划线前缀),这是 napcat 扩展 API,标准 send_group_notice 不可用。

禁言成员(单位:秒,0为解除)

node onebot-action.js set_group_ban group_id=<群号> user_id=<QQ号> duration=600
  • duration=0 解除禁言
  • duration=3600 禁言1小时
  • duration=86400 禁言1天
  • duration=2592000 禁言30天

全员禁言

# 开启全员禁言
node onebot-action.js set_group_whole_ban group_id=<群号> enable=1
# 关闭全员禁言
node onebot-action.js set_group_whole_ban group_id=<群号> enable=0

踢出成员

node onebot-action.js set_group_kick group_id=<群号> user_id=<QQ号> reject_add_request=0
  • reject_add_request=1 拒绝再次加群

设置/取消群管理员

# 设置管理员
node onebot-action.js set_group_admin group_id=<群号> user_id=<QQ号> enable=1
# 取消管理员
node onebot-action.js set_group_admin group_id=<群号> user_id=<QQ号> enable=0

设置群成员名片

node onebot-action.js set_group_card group_id=<群号> user_id=<QQ号> card="新名片"

设置群成员头衔

node onebot-action.js set_group_special_title group_id=<群号> user_id=<QQ号> title="头衔" duration=-1

设置群头像

node onebot-action.js set_group_portrait group_id=<群号> file="<图片路径>"

⚠️ API 名称是 set_group_portrait(go-cqhttp 扩展 API),不是 OneBot 11 标准的 set_group_avatar。Bot 需要管理员权限。

  • file 支持本地路径(如 /tmp/openclaw-onebot/xxx.png)、file:// 协议、base64:// 协议、HTTP URL

撤回消息

node onebot-action.js delete_msg message_id=<消息ID>

获取群信息

node onebot-action.js get_group_info group_id=<群号>

获取群成员列表

node onebot-action.js get_group_member_list group_id=<群号>

获取群成员信息

node onebot-action.js get_group_member_info group_id=<群号> user_id=<QQ号>

注意事项

  • 群号 > 100000000 时 OneBot 插件可能误判为用户 ID,脚本直接传数字即可
  • Bot 需要对应的管理员权限才能执行这些操作
  • 敏感操作(踢人、禁言)执行前应先确认
  • 默认连接 ws://127.0.0.1:13001,可通过环境变量 ONEBOT_WS_URLONEBOT_WS_TOKEN 覆盖

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

Verified Agent Identity Masud

Billions decentralized identity for agents. Link agents to human identities using Billions ERC-8004 and Attestation Registries. Verify and generate authentic...

Registry SourceRecently Updated
Automation

MacOS LaunchDaemon Scheduler

在 macOS 环境下使用 launchctl 定时启动或停止应用。当用户要求「定时启动/停止某个应用」「设置定时任务」「用 launchctl 管理应用」「每天几点自动打开XX」「定时关闭XX」时应使用本 Skill。支持自然语言时间描述(如「每天9点」「每2小时」「每周一上午8点」)和标准 cron 表达式,...

Registry SourceRecently Updated
Automation

autospec

You are a formal specification synthesis agent with expertise in automatic generation of preconditions, postconditions, loop invariants,. Use when: automatic...

Registry SourceRecently Updated
Automation

autonomous-agent

You are a Tier 3 autonomous agent capable of goal-directed planning, adaptive learning, and self-correction with minimal human supervision. Use when: goal-di...

Registry SourceRecently Updated