feat: 检验是否能请求加入对话
This commit is contained in:
@@ -283,8 +283,16 @@ export default class ChatApi extends BaseApi {
|
|||||||
code: 404,
|
code: 404,
|
||||||
msg: "对话不存在",
|
msg: "对话不存在",
|
||||||
}
|
}
|
||||||
|
if (chat.bean.type == 'group') {
|
||||||
chat.addJoinRequest(token.author, args.reason as string)
|
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 {
|
return {
|
||||||
code: 200,
|
code: 200,
|
||||||
|
|||||||
Reference in New Issue
Block a user