iTXTech / mirai-native

强大的 mirai 原生插件加载器
GNU Affero General Public License v3.0
371 stars 141 forks source link

禁用外部响应native命令 #111

Closed wlt233 closed 3 years ago

wlt233 commented 3 years ago

特性描述

控制台外部(指qq群内或私聊bot)发送 /help/npm 等命令会直接收到 bot “权限不足” 的回复,并且似乎不会上报至 cqhttp。希望能够禁用外部响应。

PeratX commented 3 years ago

默認是禁止在qq内發送指令的,需要額外的組件 詳見 https://github.com/project-mirai/chat-command

wlt233 commented 3 years ago

呃,那么烦请大佬查看一下是否是 bug...

环境如下:

mirai-console:1.0-M4
mirai-console-pure:1.0-M4
mirai-core-qqandroid:1.2.3
mirai-native-1.9.2

日志如下:

后端(nonebot)日志:
[2020-11-24 21:09:07,602] INFO in __init__: received event: meta_event.heartbeat
[2020-11-24 21:09:13,586 nonebot] INFO: Self: <bot_qq>, Message 7180 from <user_qq>@[群:<group_id>]: 'teststart'
[2020-11-24 21:09:13,602 nonebot] DEBUG: Parsing command: 'teststart'
[2020-11-24 21:09:13,602 nonebot] DEBUG: Matched command start: (empty)
[2020-11-24 21:09:13,602 nonebot] DEBUG: Split command name: ('teststart',)
[2020-11-24 21:09:13,602 nonebot] DEBUG: Command ('teststart',) not found. Try to match aliases
[2020-11-24 21:09:13,602 nonebot] DEBUG: Alias ('teststart',) not found. Try to match patterns
[2020-11-24 21:09:13,602 nonebot] DEBUG: Not a known command, ignored
[2020-11-24 21:09:13,586] INFO in __init__: received event: message.group.normal
[2020-11-24 21:09:22,617] INFO in __init__: received event: meta_event.heartbeat
[2020-11-24 21:09:26,133 nonebot] INFO: Self: <bot_qq>, Message 7181 from <user_qq>@[群:<group_id>]: 'testend'
[2020-11-24 21:09:26,133 nonebot] DEBUG: Parsing command: 'testend'
[2020-11-24 21:09:26,133 nonebot] DEBUG: Matched command start: (empty)
[2020-11-24 21:09:26,133 nonebot] DEBUG: Split command name: ('testend',)
[2020-11-24 21:09:26,133 nonebot] DEBUG: Command ('testend',) not found. Try to match aliases
[2020-11-24 21:09:26,149 nonebot] DEBUG: Alias ('testend',) not found. Try to match patterns
[2020-11-24 21:09:26,149 nonebot] DEBUG: Not a known command, ignored
[2020-11-24 21:09:26,133] INFO in __init__: received event: message.group.normal

native控制台:
2020-11-24 21:09:07 I/MiraiNative: [CQHTTP 反向WS] 通过反向 WebSocket 客户端上报数据到 ws://127.0.0.1:8520/ws/ 成功
2020-11-24 21:09:13 V/Bot <bot_qq>: [Overflow.test( )(<group_id>)] 某魏@brand new stack(<user_qq>) -> [mirai:source:15741,1341774857]teststart
2020-11-24 21:09:13 I/MiraiNative: [CQHTTP 反向WS] 通过反向 WebSocket 客户端上报数据到 ws://127.0.0.1:8520/ws/ 成功
2020-11-24 21:09:13 I/MiraiNative: [CQHTTP WS API] 已成功处理一个 API 请求:get_group_member_info
2020-11-24 21:09:15 V/Bot <bot_qq>: [Overflow.test( )(<group_id>)] 某魏@brand new stack(<user_qq>) -> [mirai:source:15742,-1131022504]/npm
2020-11-24 21:09:15 V/Bot <bot_qq>: Group(<group_id>) <- 权限不足
2020-11-24 21:09:19 V/Bot <bot_qq>: [Overflow.test( )(<group_id>)] 某魏@brand new stack(<user_qq>) -> [mirai:source:15744,-1212791534]/help
2020-11-24 21:09:19 V/Bot <bot_qq>: Group(<group_id>) <- 权限不足
2020-11-24 21:09:22 I/MiraiNative: [CQHTTP 反向WS] 通过反向 WebSocket 客户端上报数据到 ws://127.0.0.1:8520/ws/ 成功
2020-11-24 21:09:26 V/Bot <bot_qq>: [Overflow.test( )(<group_id>)] 某魏@brand new stack(<user_qq>) -> [mirai:source:15746,997821149]testend
2020-11-24 21:09:26 I/MiraiNative: [CQHTTP 反向WS] 通过反向 WebSocket 客户端上报数据到 ws://127.0.0.1:8520/ws/ 成功

插件列表:
> npm list
共加载了 1 个 Mirai Native 插件
Id:0 标识符:io.github.richardchien.coolqhttpapi 名称:CQHTTP 版本:4.15.0 状态:已启用 已加载
>
PeratX commented 3 years ago

这些版本已经停止支持,请使用 mirai core 1.3.3 mirai console 1.0.x mirai native 1.9.4

wlt233 commented 3 years ago

已使用 mcl 1.0.2 更新至以上版本,问题不再复现。十分感谢大佬。