|
@@ -22,7 +22,6 @@ Object.defineProperty(exports, "urlSegmentToId", { enumerable: true, get: functi
|
|
|
const instagram_private_api_1 = require("instagram-private-api");
|
|
|
const socks_proxy_agent_1 = require("socks-proxy-agent");
|
|
|
const loggers_1 = require("./loggers");
|
|
|
-const koishi_1 = require("./koishi");
|
|
|
const utils_1 = require("./utils");
|
|
|
const webshot_1 = require("./webshot");
|
|
|
const parseLink = (link) => {
|
|
@@ -285,15 +284,14 @@ class default_1 {
|
|
|
this.getMedia = (segmentId, sender) => this.workOnMedia([this.lazyGetMediaById(instagram_id_to_url_segment_1.urlSegmentToInstagramId(segmentId))], sender);
|
|
|
this.sendMedia = (source, ...to) => (msg, text, author) => {
|
|
|
to.forEach(subscriber => {
|
|
|
- logger.info(`pushing data${source ? ` of ${koishi_1.Message.ellipseBase64(source)}` : ''} to ${JSON.stringify(subscriber)}`);
|
|
|
+ logger.info(`pushing data${source ? ` of ${source}` : ''} to ${JSON.stringify(subscriber)}`);
|
|
|
retryOnError(() => this.bot.sendTo(subscriber, msg), (_, count, terminate) => {
|
|
|
if (count <= maxTrials) {
|
|
|
logger.warn(`retry sending to ${subscriber.chatID} for the ${ordinal(count)} time...`);
|
|
|
}
|
|
|
else {
|
|
|
- logger.warn(`${count - 1} consecutive failures while sending` +
|
|
|
- 'message chain, trying plain text instead...');
|
|
|
- terminate(this.bot.sendTo(subscriber, author + text));
|
|
|
+ logger.warn(`${count - 1} consecutive failures while sending message chain, trying plain text instead...`);
|
|
|
+ terminate(this.bot.sendTo(subscriber, author + text, true));
|
|
|
}
|
|
|
});
|
|
|
});
|