fix(archive): pass id

This commit is contained in:
vulet 2020-07-08 04:54:05 +08:00
parent 748ab6ca0a
commit 292cca6f29

View file

@ -73,7 +73,7 @@ const run = async (matrixClient, { roomId }, userInput, rearchive, registrar) =>
let tries = 30; let tries = 30;
while (tries--) { while (tries--) {
await sleep(10000); await sleep(10000);
const { title, date } = await archive(instance, userInput); const { title, date, id } = await archive(instance, userInput);
if (rearchive == false && title !== undefined) if (rearchive == false && title !== undefined)
return await editNoticeHTML(matrixClient, roomId, reply, arc2Str(`${config.domain}${id}`, title, date)); return await editNoticeHTML(matrixClient, roomId, reply, arc2Str(`${config.domain}${id}`, title, date));
const { request: { path: reqPath }, headers: { 'memento-datetime': rearchiveDate } } = await instance({ method: 'HEAD', url: path[1] }) const { request: { path: reqPath }, headers: { 'memento-datetime': rearchiveDate } } = await instance({ method: 'HEAD', url: path[1] })