🐛 message attachment url
This commit is contained in:
parent
bf42a92574
commit
1c49d82400
@ -3,6 +3,7 @@ import {
|
|||||||
Attachment,
|
Attachment,
|
||||||
Channel,
|
Channel,
|
||||||
ChannelType,
|
ChannelType,
|
||||||
|
Config,
|
||||||
DmChannelDTO,
|
DmChannelDTO,
|
||||||
Embed,
|
Embed,
|
||||||
emitEvent,
|
emitEvent,
|
||||||
@ -15,6 +16,7 @@ import { HTTPError } from "lambert-server";
|
|||||||
import { handleMessage, postHandleMessage, route } from "@fosscord/api";
|
import { handleMessage, postHandleMessage, route } from "@fosscord/api";
|
||||||
import multer from "multer";
|
import multer from "multer";
|
||||||
import { FindManyOptions, LessThan, MoreThan } from "typeorm";
|
import { FindManyOptions, LessThan, MoreThan } from "typeorm";
|
||||||
|
import { URL } from "url";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
|
|
||||||
@ -111,6 +113,9 @@ router.get("/", async (req: Request, res: Response) => {
|
|||||||
});
|
});
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (!x.author) x.author = { discriminator: "0000", username: "Deleted User", public_flags: "0", avatar: null };
|
if (!x.author) x.author = { discriminator: "0000", username: "Deleted User", public_flags: "0", avatar: null };
|
||||||
|
x.attachments?.forEach((x) => {
|
||||||
|
x.proxy_url = `${Config.get().cdn.endpointPublic || "http://localhost:3003"}${new URL(x.proxy_url).pathname}`;
|
||||||
|
});
|
||||||
|
|
||||||
return x;
|
return x;
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user