🐛 修复某些情况下通知消息无法发出

Signed-off-by: 等风来 <3139373986@qq.com>
This commit is contained in:
等风来
2024-06-23 16:17:26 +08:00
parent ce82f7b313
commit 4b2bd367d5

View File

@@ -11,7 +11,6 @@ export default class {
*/
async sendMasterMsg(msg, botUin = Bot.uin) {
let masterQQ = Config.masterQQ
const bot = Bot[botUin] ?? Bot
if (Config.master) {
const master = Config.master[botUin]
if (master?.length) {
@@ -21,10 +20,13 @@ export default class {
}
}
if (Config.whole.notificationsAll) { // 发送全部主人
for (const i of masterQQ) {
if (bot && !bot.fl.get(i)) continue
common.relpyPrivate(i, msg, botUin)
await common.sleep(5000)
if (Bot?.sendMasterMsg) {
await Bot.sendMasterMsg(msg, Bot.uin, 5000)
} else {
for (const i of masterQQ) {
common.relpyPrivate(i, msg, botUin)
await common.sleep(5000)
}
}
} else { // 发给第一个主人
return common.relpyPrivate(masterQQ[0], msg, botUin)