mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 13:05:09 +00:00
feat: NTGroupMemberRole
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { GroupMemberRole } from '@/core/entities';
|
||||
import { NTGroupMemberRole } from '@/core/entities';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
|
||||
@@ -23,7 +23,7 @@ export default class SetGroupAdmin extends OneBotAction<Payload, null> {
|
||||
const enable = typeof payload.enable === 'string' ? payload.enable === 'true' : !!payload.enable;
|
||||
const uid = await this.core.apis.UserApi.getUidByUinV2(payload.user_id.toString());
|
||||
if (!uid) throw new Error('get Uid Error');
|
||||
await this.core.apis.GroupApi.setMemberRole(payload.group_id.toString(), uid, enable ? GroupMemberRole.admin : GroupMemberRole.normal);
|
||||
await this.core.apis.GroupApi.setMemberRole(payload.group_id.toString(), uid, enable ? NTGroupMemberRole.KADMIN : NTGroupMemberRole.KMEMBER);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
BuddyReqType,
|
||||
ChatType,
|
||||
DataSource,
|
||||
GroupMemberRole,
|
||||
NTGroupMemberRole,
|
||||
GroupNotifyMsgStatus,
|
||||
GroupNotifyMsgType,
|
||||
InstanceContext,
|
||||
@@ -524,7 +524,7 @@ export class NapCatOneBot11Adapter {
|
||||
this.core,
|
||||
parseInt(groupCode),
|
||||
parseInt(member.uin),
|
||||
member.role === GroupMemberRole.admin ? 'set' : 'unset'
|
||||
member.role === NTGroupMemberRole.KADMIN ? 'set' : 'unset'
|
||||
);
|
||||
this.networkManager
|
||||
.emitEvent(groupAdminNoticeEvent)
|
||||
|
||||
Reference in New Issue
Block a user