mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
chore: lint
This commit is contained in:
parent
e5d9df37c5
commit
a201461eff
@ -44,12 +44,12 @@ export class NTQQGroupApi {
|
|||||||
type ListenerType = NodeIKernelGroupListener['onGroupListUpdate'];
|
type ListenerType = NodeIKernelGroupListener['onGroupListUpdate'];
|
||||||
const [_retData, _updateType, groupList] = await this.core.eventWrapper.CallNormalEvent<(force: boolean) => Promise<any>, ListenerType>
|
const [_retData, _updateType, groupList] = await this.core.eventWrapper.CallNormalEvent<(force: boolean) => Promise<any>, ListenerType>
|
||||||
(
|
(
|
||||||
'NodeIKernelGroupService/getGroupList',
|
'NodeIKernelGroupService/getGroupList',
|
||||||
'NodeIKernelGroupListener/onGroupListUpdate',
|
'NodeIKernelGroupListener/onGroupListUpdate',
|
||||||
1,
|
1,
|
||||||
5000,
|
5000,
|
||||||
() => true,
|
() => true,
|
||||||
forced,
|
forced,
|
||||||
);
|
);
|
||||||
return groupList;
|
return groupList;
|
||||||
}
|
}
|
||||||
@ -229,7 +229,7 @@ export class NTQQGroupApi {
|
|||||||
return this.context.session.getGroupService().deleteGroupBulletin(GroupCode, _Pskey, feedId);
|
return this.context.session.getGroupService().deleteGroupBulletin(GroupCode, _Pskey, feedId);
|
||||||
}
|
}
|
||||||
async quitGroupV2(GroupCode: string, needDeleteLocalMsg: boolean) {
|
async quitGroupV2(GroupCode: string, needDeleteLocalMsg: boolean) {
|
||||||
let param = {
|
const param = {
|
||||||
groupCode: GroupCode,
|
groupCode: GroupCode,
|
||||||
needDeleteLocalMsg: needDeleteLocalMsg
|
needDeleteLocalMsg: needDeleteLocalMsg
|
||||||
};
|
};
|
||||||
@ -256,14 +256,14 @@ export class NTQQGroupApi {
|
|||||||
async getSingleScreenNotifies(num: number) {
|
async getSingleScreenNotifies(num: number) {
|
||||||
const [_retData, _doubt, _seq, notifies] = await this.core.eventWrapper.CallNormalEvent<(arg1: boolean, arg2: string, arg3: number) => Promise<any>, (doubt: boolean, seq: string, notifies: GroupNotify[]) => void>
|
const [_retData, _doubt, _seq, notifies] = await this.core.eventWrapper.CallNormalEvent<(arg1: boolean, arg2: string, arg3: number) => Promise<any>, (doubt: boolean, seq: string, notifies: GroupNotify[]) => void>
|
||||||
(
|
(
|
||||||
'NodeIKernelGroupService/getSingleScreenNotifies',
|
'NodeIKernelGroupService/getSingleScreenNotifies',
|
||||||
'NodeIKernelGroupListener/onGroupSingleScreenNotifies',
|
'NodeIKernelGroupListener/onGroupSingleScreenNotifies',
|
||||||
1,
|
1,
|
||||||
5000,
|
5000,
|
||||||
() => true,
|
() => true,
|
||||||
false,
|
false,
|
||||||
'',
|
'',
|
||||||
num,
|
num,
|
||||||
);
|
);
|
||||||
return notifies;
|
return notifies;
|
||||||
}
|
}
|
||||||
@ -275,12 +275,12 @@ export class NTQQGroupApi {
|
|||||||
//return napCatCore.session.getGroupService().getMemberInfo(GroupCode, [uid], forced);
|
//return napCatCore.session.getGroupService().getMemberInfo(GroupCode, [uid], forced);
|
||||||
const Listener = this.core.eventWrapper.RegisterListen<(params: any) => void>
|
const Listener = this.core.eventWrapper.RegisterListen<(params: any) => void>
|
||||||
(
|
(
|
||||||
'NodeIKernelGroupListener/onMemberInfoChange',
|
'NodeIKernelGroupListener/onMemberInfoChange',
|
||||||
1,
|
1,
|
||||||
forced ? 5000 : 250,
|
forced ? 5000 : 250,
|
||||||
(params) => {
|
(params) => {
|
||||||
return params === GroupCode;
|
return params === GroupCode;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
const EventFunc = this.core.eventWrapper.createEventFunction<EventType>('NodeIKernelGroupService/getMemberInfo');
|
const EventFunc = this.core.eventWrapper.createEventFunction<EventType>('NodeIKernelGroupService/getMemberInfo');
|
||||||
const retData = await EventFunc!(GroupCode, [uid], forced);
|
const retData = await EventFunc!(GroupCode, [uid], forced);
|
||||||
@ -349,7 +349,7 @@ export class NTQQGroupApi {
|
|||||||
'NodeIKernelGroupService/getGroupRecommendContactArkJson',
|
'NodeIKernelGroupService/getGroupRecommendContactArkJson',
|
||||||
5000,
|
5000,
|
||||||
GroupCode,
|
GroupCode,
|
||||||
);
|
);
|
||||||
return ret.arkJson;
|
return ret.arkJson;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ export class NTQQWebApi {
|
|||||||
msg_random: msgRandom,
|
msg_random: msgRandom,
|
||||||
target_group_code: targetGroupCode,
|
target_group_code: targetGroupCode,
|
||||||
}).toString()
|
}).toString()
|
||||||
}`;
|
}`;
|
||||||
try {
|
try {
|
||||||
return RequestUtil.HttpGetText(url, 'GET', '', { 'Cookie': this.cookieToString(cookieObject) });
|
return RequestUtil.HttpGetText(url, 'GET', '', { 'Cookie': this.cookieToString(cookieObject) });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -43,11 +43,11 @@ export class NTQQWebApi {
|
|||||||
page_start,
|
page_start,
|
||||||
page_limit: '20',
|
page_limit: '20',
|
||||||
}).toString()
|
}).toString()
|
||||||
}`;
|
}`;
|
||||||
let ret;
|
let ret;
|
||||||
try {
|
try {
|
||||||
ret = await RequestUtil.HttpGetJson<GroupEssenceMsgRet>
|
ret = await RequestUtil.HttpGetJson<GroupEssenceMsgRet>
|
||||||
(url, 'GET', '', { 'Cookie': this.cookieToString(cookieObject) });
|
(url, 'GET', '', { 'Cookie': this.cookieToString(cookieObject) });
|
||||||
} catch {
|
} catch {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@ -63,14 +63,14 @@ export class NTQQWebApi {
|
|||||||
const cookieObject = await this.core.apis.UserApi.getCookies('qun.qq.com');
|
const cookieObject = await this.core.apis.UserApi.getCookies('qun.qq.com');
|
||||||
const retList: Promise<WebApiGroupMemberRet>[] = [];
|
const retList: Promise<WebApiGroupMemberRet>[] = [];
|
||||||
const fastRet = await RequestUtil.HttpGetJson<WebApiGroupMemberRet>
|
const fastRet = await RequestUtil.HttpGetJson<WebApiGroupMemberRet>
|
||||||
(`https://qun.qq.com/cgi-bin/qun_mgr/search_group_members?${new URLSearchParams({
|
(`https://qun.qq.com/cgi-bin/qun_mgr/search_group_members?${new URLSearchParams({
|
||||||
st: '0',
|
st: '0',
|
||||||
end: '40',
|
end: '40',
|
||||||
sort: '1',
|
sort: '1',
|
||||||
gc: GroupCode,
|
gc: GroupCode,
|
||||||
bkn: this.getBknFromCookie(cookieObject),
|
bkn: this.getBknFromCookie(cookieObject),
|
||||||
}).toString()
|
}).toString()
|
||||||
}`, 'POST', '', { 'Cookie': this.cookieToString(cookieObject) });
|
}`, 'POST', '', { 'Cookie': this.cookieToString(cookieObject) });
|
||||||
if (!fastRet?.count || fastRet?.errcode !== 0 || !fastRet?.mems) {
|
if (!fastRet?.count || fastRet?.errcode !== 0 || !fastRet?.mems) {
|
||||||
return [];
|
return [];
|
||||||
} else {
|
} else {
|
||||||
@ -83,14 +83,14 @@ export class NTQQWebApi {
|
|||||||
//遍历批量请求
|
//遍历批量请求
|
||||||
for (let i = 2; i <= PageNum; i++) {
|
for (let i = 2; i <= PageNum; i++) {
|
||||||
const ret = RequestUtil.HttpGetJson<WebApiGroupMemberRet>
|
const ret = RequestUtil.HttpGetJson<WebApiGroupMemberRet>
|
||||||
(`https://qun.qq.com/cgi-bin/qun_mgr/search_group_members?${new URLSearchParams({
|
(`https://qun.qq.com/cgi-bin/qun_mgr/search_group_members?${new URLSearchParams({
|
||||||
st: ((i - 1) * 40).toString(),
|
st: ((i - 1) * 40).toString(),
|
||||||
end: (i * 40).toString(),
|
end: (i * 40).toString(),
|
||||||
sort: '1',
|
sort: '1',
|
||||||
gc: GroupCode,
|
gc: GroupCode,
|
||||||
bkn: this.getBknFromCookie(cookieObject),
|
bkn: this.getBknFromCookie(cookieObject),
|
||||||
}).toString()
|
}).toString()
|
||||||
}`, 'POST', '', { 'Cookie': this.cookieToString(cookieObject) });
|
}`, 'POST', '', { 'Cookie': this.cookieToString(cookieObject) });
|
||||||
retList.push(ret);
|
retList.push(ret);
|
||||||
}
|
}
|
||||||
//批量等待
|
//批量等待
|
||||||
@ -123,15 +123,15 @@ export class NTQQWebApi {
|
|||||||
let ret: any = undefined;
|
let ret: any = undefined;
|
||||||
try {
|
try {
|
||||||
ret = await RequestUtil.HttpGetJson<any>
|
ret = await RequestUtil.HttpGetJson<any>
|
||||||
(`https://web.qun.qq.com/cgi-bin/announce/add_qun_notice${new URLSearchParams({
|
(`https://web.qun.qq.com/cgi-bin/announce/add_qun_notice${new URLSearchParams({
|
||||||
bkn: this.getBknFromCookie(cookieObject),
|
bkn: this.getBknFromCookie(cookieObject),
|
||||||
qid: GroupCode,
|
qid: GroupCode,
|
||||||
text: Content,
|
text: Content,
|
||||||
pinned: '0',
|
pinned: '0',
|
||||||
type: '1',
|
type: '1',
|
||||||
settings: '{"is_show_edit_card":1,"tip_window_type":1,"confirm_required":1}',
|
settings: '{"is_show_edit_card":1,"tip_window_type":1,"confirm_required":1}',
|
||||||
}).toString()
|
}).toString()
|
||||||
}`, 'GET', '', { 'Cookie': this.cookieToString(cookieObject) });
|
}`, 'GET', '', { 'Cookie': this.cookieToString(cookieObject) });
|
||||||
return ret;
|
return ret;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return undefined;
|
return undefined;
|
||||||
@ -162,7 +162,7 @@ export class NTQQWebApi {
|
|||||||
gc: Internal_groupCode,
|
gc: Internal_groupCode,
|
||||||
type: Internal_type.toString(),
|
type: Internal_type.toString(),
|
||||||
}).toString()
|
}).toString()
|
||||||
}`;
|
}`;
|
||||||
let resJson;
|
let resJson;
|
||||||
try {
|
try {
|
||||||
const res = await RequestUtil.HttpGetText(url, 'GET', '', { 'Cookie': this.cookieToString(cookieObject) });
|
const res = await RequestUtil.HttpGetText(url, 'GET', '', { 'Cookie': this.cookieToString(cookieObject) });
|
||||||
|
@ -68,7 +68,7 @@ const _handlers: {
|
|||||||
}
|
}
|
||||||
const uid = await NTQQUserApi.getUidByUinV2(`${atQQ}`);
|
const uid = await NTQQUserApi.getUidByUinV2(`${atQQ}`);
|
||||||
if (!uid) throw new Error('Get Uid Error');
|
if (!uid) throw new Error('Get Uid Error');
|
||||||
let info = await NTQQUserApi.getUserDetailInfo(uid);
|
const info = await NTQQUserApi.getUserDetailInfo(uid);
|
||||||
return SendMsgElementConstructor.at(coreContext, atQQ, uid, AtType.atUser, info.nick || '');
|
return SendMsgElementConstructor.at(coreContext, atQQ, uid, AtType.atUser, info.nick || '');
|
||||||
},
|
},
|
||||||
[OB11MessageDataType.reply]: async (coreContext, obContext: NapCatOneBot11Adapter, { data: { id } }) => {
|
[OB11MessageDataType.reply]: async (coreContext, obContext: NapCatOneBot11Adapter, { data: { id } }) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user