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

This commit is contained in:
mattyatea 2023-12-23 10:44:13 +09:00
parent 2a9ddf2bc8
commit 56fb028855

View file

@ -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;