Skip to content

Commit d75887f

Browse files
committed
fix: remove user_id parameter from GetPrivateFileUrl
1 parent 3a4e2ee commit d75887f

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/onebot11/action/llonebot/file/GetPrivateFileUrl.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { selfInfo } from '@/common/globalVars'
44

55
export interface Payload {
66
file_id: string
7-
user_id?: string
87
}
98

109
export interface Response {
@@ -15,15 +14,10 @@ export class GetPrivateFileUrl extends BaseAction<Payload, Response> {
1514
actionName = ActionName.GetPrivateFileUrl
1615
payloadSchema = Schema.object({
1716
file_id: Schema.string().required(),
18-
user_id: Schema.string()
1917
})
2018

2119
protected async _handle(payload: Payload) {
22-
let receiverUid = selfInfo.uid
23-
if (payload.user_id) {
24-
receiverUid = await this.ctx.ntUserApi.getUidByUin(payload.user_id)
25-
}
26-
const url = await this.ctx.app.pmhq.getPrivateFileUrl(receiverUid, payload.file_id)
20+
const url = await this.ctx.app.pmhq.getPrivateFileUrl(selfInfo.uid, payload.file_id)
2721
return { url }
2822
}
2923
}

0 commit comments

Comments
 (0)