mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
chore: boolen值校验
This commit is contained in:
@@ -20,7 +20,7 @@ class GetGroupList extends BaseAction<Payload, OB11Group[]> {
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
const NTQQGroupApi = this.CoreContext.apis.GroupApi;
|
||||
const groupList: Group[] = await NTQQGroupApi.getGroups(payload?.no_cache === true || payload.no_cache === 'true');
|
||||
const groupList: Group[] = await NTQQGroupApi.getGroups(typeof payload.no_cache === 'string' ? payload.no_cache === 'true' : !!payload.no_cache);
|
||||
return OB11Constructor.groups(groupList);
|
||||
}
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ class GetGroupMemberInfo extends BaseAction<Payload, OB11GroupMember> {
|
||||
const NTQQUserApi = this.CoreContext.apis.UserApi;
|
||||
const NTQQGroupApi = this.CoreContext.apis.GroupApi;
|
||||
const NTQQWebApi = this.CoreContext.apis.WebApi;
|
||||
const isNocache = payload.no_cache == true || payload.no_cache === 'true';
|
||||
const isNocache = typeof payload.no_cache === 'string' ? payload.no_cache === 'true' : !!payload.no_cache;
|
||||
const uid = await NTQQUserApi.getUidByUinV2(payload.user_id.toString());
|
||||
if (!uid) throw (`Uin2Uid Error ${payload.user_id}不存在`);
|
||||
const member = await NTQQGroupApi.getGroupMemberV2(payload.group_id.toString(), uid, isNocache);
|
||||
|
@@ -22,7 +22,6 @@ class GetGroupMemberList extends BaseAction<Payload, OB11GroupMember[]> {
|
||||
async _handle(payload: Payload) {
|
||||
const NTQQGroupApi = this.CoreContext.apis.GroupApi;
|
||||
const NTQQWebApi = this.CoreContext.apis.WebApi;
|
||||
//const isNocache = payload.no_cache == true || payload.no_cache === 'true';//已强制无缓存
|
||||
const groupMembers = await NTQQGroupApi.getGroupMembers(payload.group_id.toString());
|
||||
const groupMembersArr = Array.from(groupMembers.values());
|
||||
|
||||
|
@@ -20,7 +20,7 @@ export default class SetGroupAdmin extends BaseAction<Payload, null> {
|
||||
PayloadSchema = SchemaData;
|
||||
|
||||
async _handle(payload: Payload): Promise<null> {
|
||||
const enable = typeof payload.enable === 'string' ? payload.enable === 'true' : payload.enable;
|
||||
const enable = typeof payload.enable === 'string' ? payload.enable === 'true' : !!payload.enable;
|
||||
const NTQQGroupApi = this.CoreContext.apis.GroupApi;
|
||||
const NTQQUserApi = this.CoreContext.apis.UserApi;
|
||||
const uid = await NTQQUserApi.getUidByUinV2(payload.user_id.toString());
|
||||
|
@@ -153,7 +153,7 @@ export class SendMsg extends BaseAction<OB11PostSendMsg, ReturnDataType> {
|
||||
|
||||
const messages = normalize(
|
||||
payload.message,
|
||||
payload.auto_escape === true || payload.auto_escape === 'true',
|
||||
typeof payload.auto_escape === 'string' ? payload.auto_escape === 'true' : !!payload.auto_escape
|
||||
);
|
||||
|
||||
if (getSpecialMsgNum(payload, OB11MessageDataType.node)) {
|
||||
|
@@ -20,6 +20,6 @@ export default class GetFriendList extends BaseAction<Payload, OB11User[]> {
|
||||
async _handle(payload: Payload) {
|
||||
//全新逻辑
|
||||
const NTQQFriendApi = this.CoreContext.apis.FriendApi;
|
||||
return OB11Constructor.friendsV2(await NTQQFriendApi.getBuddyV2(payload?.no_cache === true || payload?.no_cache === 'true'));
|
||||
return OB11Constructor.friendsV2(await NTQQFriendApi.getBuddyV2(typeof payload.no_cache === 'string' ? payload.no_cache === 'true' : !!payload.no_cache));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user