|
@@ -134,6 +134,8 @@ class Webshot extends CallableInstance<[Tweets, (...args) => void, number], Prom
|
|
|
})
|
|
|
.then(() => handle)
|
|
|
)
|
|
|
+ // throw early if tweet is unavailable
|
|
|
+ .then(handle => handle.$('xpath=.//a[contains(@href,"notices-on-twitter")]').then(placeholder => placeholder ? null : handle))
|
|
|
.catch((err: Error): Promise<puppeteer.ElementHandle<HTMLDivElement> | null> => {
|
|
|
if (err.name !== 'TimeoutError') throw err;
|
|
|
logger.warn(`navigation timed out at ${getTimerTime()} ms`);
|
|
@@ -330,7 +332,7 @@ class Webshot extends CallableInstance<[Tweets, (...args) => void, number], Prom
|
|
|
promise = promise.then(() => this.renderWebshot(url, 1920, webshotDelay))
|
|
|
.then(fileurl => {
|
|
|
if (fileurl) return Message.Image(fileurl);
|
|
|
- return author + text;
|
|
|
+ return '[截图不可用] ' + author + text;
|
|
|
})
|
|
|
.then(msg => {
|
|
|
if (msg) messageChain += msg;
|