|
@@ -19,7 +19,6 @@ const util_1 = require("util");
|
|
const instagram_private_api_1 = require("instagram-private-api");
|
|
const instagram_private_api_1 = require("instagram-private-api");
|
|
const socks_proxy_agent_1 = require("socks-proxy-agent");
|
|
const socks_proxy_agent_1 = require("socks-proxy-agent");
|
|
const loggers_1 = require("./loggers");
|
|
const loggers_1 = require("./loggers");
|
|
-const koishi_1 = require("./koishi");
|
|
|
|
const utils_1 = require("./utils");
|
|
const utils_1 = require("./utils");
|
|
const webshot_1 = require("./webshot");
|
|
const webshot_1 = require("./webshot");
|
|
const parseLink = (link) => {
|
|
const parseLink = (link) => {
|
|
@@ -196,15 +195,14 @@ class default_1 {
|
|
this.workOnMedia = (mediaItems, sendMedia) => this.webshot(mediaItems, sendMedia, this.webshotDelay);
|
|
this.workOnMedia = (mediaItems, sendMedia) => this.webshot(mediaItems, sendMedia, this.webshotDelay);
|
|
this.sendStories = (source, ...to) => (msg, text, author) => {
|
|
this.sendStories = (source, ...to) => (msg, text, author) => {
|
|
to.forEach(subscriber => {
|
|
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) => {
|
|
retryOnError(() => this.bot.sendTo(subscriber, msg), (_, count, terminate) => {
|
|
if (count <= maxTrials) {
|
|
if (count <= maxTrials) {
|
|
logger.warn(`retry sending to ${subscriber.chatID} for the ${ordinal(count)} time...`);
|
|
logger.warn(`retry sending to ${subscriber.chatID} for the ${ordinal(count)} time...`);
|
|
}
|
|
}
|
|
else {
|
|
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));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|