Skip to content

Commit 5e27ab8

Browse files
committed
fix: fix converse permission check for pluginBot
pluginBot should has all permission
1 parent 4b0fc66 commit 5e27ab8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

server/services/core/chat/message.service.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,12 @@ class MessageService extends TcService {
463463
return;
464464
}
465465

466+
const userInfo = await call(ctx).getUserInfo(userId); // TODO: 可以通过在默认的meta信息中追加用户类型来减少一次请求来优化
467+
if (userInfo.type === 'pluginBot') {
468+
// 如果是插件机器人则拥有所有权限(开放平台机器人需要添加到群组才有会话权限)
469+
return;
470+
}
471+
466472
// 鉴权是否能获取到会话内容
467473
if (groupId) {
468474
// 是群组

0 commit comments

Comments
 (0)