多分動くと思うからリリースしようぜ

This commit is contained in:
mattyatea 2023-12-23 10:44:13 +09:00
parent 2a9ddf2bc8
commit 56fb028855
1 changed files with 7 additions and 2 deletions

View File

@ -67,9 +67,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
if (isDuplicate || isRequestDuplicate) throw new ApiError(meta.errors.duplicateName);
let driveFile;
driveFile = await this.driveFilesRepository.findOneBy({ id: ps.fileId });
if (driveFile == null) throw new ApiError(meta.errors.noSuchFile);
let tmp = await this.driveFilesRepository.findOneBy({ id: ps.fileId });
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);
const {ApiBase,EmojiBotToken,DiscordWebhookUrl,requestEmojiAllOk} = (await this.metaService.fetch())
let emoji;