Skip to content

Commit

Permalink
fix qqmultimsg query bug for irc
Browse files Browse the repository at this point in the history
  • Loading branch information
Zokhoi committed Jan 3, 2022
1 parent f852365 commit 09154a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions plugins/qqmultimsg.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = (pluginManager, options) => {
let handler = pluginManager.handlers.get(context._from_client);
let qqHandler = pluginManager.handlers.get('QQ');
qqHandler._client.getForwardMsg(context.param.split(' ')[0]).then(res=>{
let target = context._from_client == 'IRC' ? context.from : context.to;
if (res.status=='ok') {
// console.log(res.data)
res.data.forEach(msg=>{
Expand All @@ -41,7 +42,7 @@ module.exports = (pluginManager, options) => {


if (message.extra.multimsg) {
meta.text+=`\n[私聊机器人使用 !qmulti ${message.extra.multimsg[0]}${message.extra.multimsg[1]}]`;
meta.text+=`\n[私聊机器人使用 ${command} ${message.extra.multimsg[0]}${message.extra.multimsg[1]}]`;
}

let output = format('[{nick}] {text}', meta);
Expand All @@ -57,10 +58,10 @@ module.exports = (pluginManager, options) => {
output += '\n' + file;
}

handler.say(context.to, output)
handler.say(target, output);
})
} else {
handler.say(context.to, `找不到指定的合并转发消息。`);
handler.say(target, `找不到指定的合并转发消息。`);
}
});

Expand Down

0 comments on commit 09154a4

Please sign in to comment.