多分動くと思うからリリースしようぜ
This commit is contained in:
parent
2a9ddf2bc8
commit
56fb028855
|
@ -67,9 +67,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
|
|
||||||
if (isDuplicate || isRequestDuplicate) throw new ApiError(meta.errors.duplicateName);
|
if (isDuplicate || isRequestDuplicate) throw new ApiError(meta.errors.duplicateName);
|
||||||
let driveFile;
|
let driveFile;
|
||||||
driveFile = await this.driveFilesRepository.findOneBy({ id: ps.fileId });
|
let tmp = await this.driveFilesRepository.findOneBy({ id: ps.fileId });
|
||||||
if (driveFile == null) throw new ApiError(meta.errors.noSuchFile);
|
if (tmp == null) throw new ApiError(meta.errors.noSuchFile);
|
||||||
|
|
||||||
|
try {
|
||||||
|
driveFile = await this.driveService.uploadFromUrl({ url: tmp.url , user: null, force: true });
|
||||||
|
} catch (e) {
|
||||||
|
throw new ApiError();
|
||||||
|
}
|
||||||
if (driveFile == null) throw new ApiError(meta.errors.noSuchFile);
|
if (driveFile == null) throw new ApiError(meta.errors.noSuchFile);
|
||||||
const {ApiBase,EmojiBotToken,DiscordWebhookUrl,requestEmojiAllOk} = (await this.metaService.fetch())
|
const {ApiBase,EmojiBotToken,DiscordWebhookUrl,requestEmojiAllOk} = (await this.metaService.fetch())
|
||||||
let emoji;
|
let emoji;
|
||||||
|
|
Loading…
Reference in a new issue