|
@@ -14,7 +14,6 @@ const koishi_1 = require("koishi");
|
|
|
require("koishi-adapter-onebot");
|
|
|
const command_1 = require("./command");
|
|
|
const loggers_1 = require("./loggers");
|
|
|
-const utils_1 = require("./utils");
|
|
|
const logger = loggers_1.getLogger('qqbot');
|
|
|
const cqUrlFix = (factory) => (...args) => factory(...args).replace(/(?<=\[CQ:.*)url=(?=(base64|file|https?):\/\/)/, 'file=');
|
|
|
exports.Message = {
|
|
@@ -87,7 +86,7 @@ class default_1 {
|
|
|
this.sendToUser = (userID, message) => new Promise(resolve => {
|
|
|
this.enqueue('private', userID, () => this.bot.sendPrivateMessage(userID, message).then(resolve));
|
|
|
});
|
|
|
- this.sendTo = (subscriber, messageChain) => utils_1.chainPromises((splitted => [splitted.message, ...splitted.attachments])(exports.Message.separateAttachment(messageChain)).map(msg => {
|
|
|
+ this.sendTo = (subscriber, messageChain) => 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);
|