koishi-plugin-cocoyyy-console 1.2.0-alpha.2 → 1.2.0
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 +5 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -3799,12 +3799,12 @@ async function pollAndDeliver(bot, record, config) {
|
|
|
3799
3799
|
try {
|
|
3800
3800
|
const pdfPath = task.pdf_path;
|
|
3801
3801
|
if (!pdfPath)
|
|
3802
|
-
throw new Error("
|
|
3802
|
+
throw new Error("任务成功但未返回文件路径");
|
|
3803
3803
|
const pdfBuffer = await readLocalPdf(pdfPath);
|
|
3804
|
-
const filename =
|
|
3804
|
+
const filename = `${record.albumId}.pdf` || task.pdf_filename;
|
|
3805
3805
|
message = [
|
|
3806
3806
|
(0, import_koishi17.h)("at", { id: record.userId }),
|
|
3807
|
-
` 本子
|
|
3807
|
+
` 本子[${record.albumId}]下载完成:`,
|
|
3808
3808
|
import_koishi17.h.file(pdfBuffer, "application/pdf", { name: filename })
|
|
3809
3809
|
];
|
|
3810
3810
|
} catch (error) {
|
|
@@ -3852,7 +3852,7 @@ function registerJmCommands(ctx, jm_config) {
|
|
|
3852
3852
|
albumId
|
|
3853
3853
|
};
|
|
3854
3854
|
if (!registerTask(record, jm_config))
|
|
3855
|
-
return
|
|
3855
|
+
return `当前群聊已有${maxConcurrent}个下载任务进行中,请稍后再试`;
|
|
3856
3856
|
const submitResult = await submitDownload(albumId, jm_config);
|
|
3857
3857
|
if (!submitResult.ok) {
|
|
3858
3858
|
unregisterTask(guildId, pendingTaskId);
|
|
@@ -3861,7 +3861,7 @@ function registerJmCommands(ctx, jm_config) {
|
|
|
3861
3861
|
const taskId = submitResult.data.task_id;
|
|
3862
3862
|
updateTaskId(guildId, pendingTaskId, taskId);
|
|
3863
3863
|
startJmDownload(session.bot, record, jm_config);
|
|
3864
|
-
return `已收到本子
|
|
3864
|
+
return `已收到本子[${albumId}]的下载请求,完成后会在此群@你。`;
|
|
3865
3865
|
});
|
|
3866
3866
|
}
|
|
3867
3867
|
__name(registerJmCommands, "registerJmCommands");
|