|
@@ -90,7 +90,7 @@ class default_1 {
|
|
|
this.sendToUser = (userID, message) => new Promise((resolve, reject) => {
|
|
|
this.enqueue('private', userID, () => this.bot.sendPrivateMessage(userID, message).then(resolve).catch(reject));
|
|
|
});
|
|
|
- this.sendTo = (subscriber, messageChain) => Promise.all((splitted => [splitted.message, ...splitted.attachments])(exports.Message.separateAttachment(messageChain)).map(msg => {
|
|
|
+ this.sendTo = (subscriber, messageChain, noErrors = false) => Promise.all((splitted => [splitted.message, ...splitted.attachments])(exports.Message.separateAttachment(messageChain)).map(msg => {
|
|
|
switch (subscriber.chatType) {
|
|
|
case 'group':
|
|
|
return this.sendToGroup(subscriber.chatID.toString(), msg);
|
|
@@ -107,7 +107,8 @@ class default_1 {
|
|
|
})
|
|
|
.catch(reason => {
|
|
|
logger.error(exports.Message.ellipseBase64(`error pushing data to ${JSON.stringify(subscriber.chatID)}, reason: ${reason}`));
|
|
|
- throw reason instanceof Error ? reason : Error(reason);
|
|
|
+ if (!noErrors)
|
|
|
+ throw reason instanceof Error ? reason : Error(reason);
|
|
|
});
|
|
|
this.initBot = () => {
|
|
|
this.app = new koishi_1.App({
|