feat: 检验是否能请求加入对话

This commit is contained in:
CrescentLeaf
2025-10-26 14:24:26 +08:00
parent 4e34e70a11
commit bfc14777be

View File

@@ -283,8 +283,16 @@ export default class ChatApi extends BaseApi {
code: 404,
msg: "对话不存在",
}
chat.addJoinRequest(token.author, args.reason as string)
if (chat.bean.type == 'group') {
const settings = ChatGroup.fromChat(chat).getSettings()
if (settings.settings.allow_new_member_join)
chat.addJoinRequest(token.author, args.reason as string)
else
return {
code: 403,
msg: "该对话不允许加入请求",
}
}
return {
code: 200,