koishi-plugin-maple-schedule 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +4 -11
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -231,14 +231,7 @@ function apply(ctx, config) {
|
|
|
231
231
|
} else {
|
|
232
232
|
ctx.logger("maple-schedule").info(`执行任务 #${task.id},按时在 ${shouldHaveTime} 执行`);
|
|
233
233
|
}
|
|
234
|
-
const
|
|
235
|
-
const bot = ctx.bots.find(
|
|
236
|
-
(bot2) => bot2.sid === botId || bot2.platform === task.platform && bot2.selfId === task.botId
|
|
237
|
-
);
|
|
238
|
-
if (!bot) {
|
|
239
|
-
ctx.logger("maple-schedule").warn(`机器人 ${botId} 不存在,跳过任务 #${task.id}`);
|
|
240
|
-
continue;
|
|
241
|
-
}
|
|
234
|
+
const bot = ctx.bots[0];
|
|
242
235
|
let messageContent = task.content;
|
|
243
236
|
if (isOverdue) {
|
|
244
237
|
messageContent = `过期任务: 本应在 ${shouldHaveTime} 执行
|
|
@@ -340,8 +333,8 @@ ${task.content}`;
|
|
|
340
333
|
return "页码必须是正整数!";
|
|
341
334
|
}
|
|
342
335
|
const query = {
|
|
343
|
-
platform: session.platform
|
|
344
|
-
botId: session.bot.selfId
|
|
336
|
+
platform: session.platform
|
|
337
|
+
// botId: session.bot.selfId,
|
|
345
338
|
};
|
|
346
339
|
if (session.channelId) {
|
|
347
340
|
query.channelId = session.channelId;
|
|
@@ -373,7 +366,7 @@ ${task.content}`;
|
|
|
373
366
|
if (task.intervalMs) {
|
|
374
367
|
intervalInfo = `(每${formatInterval(task.intervalMs)}) `;
|
|
375
368
|
}
|
|
376
|
-
output += `${displayIndex}. #${task.id} ${timeDisplay}${intervalInfo}${contentPreview}
|
|
369
|
+
output += `${displayIndex}. #${task.id} ${timeDisplay} ${intervalInfo} ${contentPreview}
|
|
377
370
|
`;
|
|
378
371
|
});
|
|
379
372
|
output += "\n──────────\n";
|