chore: 所有扩展接口就绪

This commit is contained in:
手瓜一十雪 committed 2024-08-09 17:01:29 +08:00
1 parent 4eed603d36
commit dfb31b78d9
9 files changed
+10 -13

No files matched your search

+2 -2
View File
@@ -26,13 +26,13 @@ export default class SetGroupHeader extends BaseAction<Payload, any> {
}
protected async _handle(payload: Payload): Promise<any> {
const NTQQGroupApi = this.CoreContext.getApiContext().GroupApi;
const { path, isLocal, errMsg,success } = (await uri2local(payload.file));
const { path, isLocal, errMsg, success } = (await uri2local(this.CoreContext.NapCatTempPath, payload.file));
if (!success) {
throw `头像${payload.file}设置失败,file字段可能格式不正确`;
}
if (path) {
await checkFileReceived(path, 5000); // 文件不存在QQ会崩溃,需要提前判断
const ret = await NTQQGroupApi.setGroupAvatar(payload.groupCode,path);
const ret = await NTQQGroupApi.setGroupAvatar(payload.groupCode, path);
if (!isLocal) {
fs.unlink(path, () => { });
}