koishi-plugin-p-draw 1.5.5 → 1.5.6
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/index.js +13 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -478,12 +478,11 @@ exports.apply = async function apply(ctx, cfg) {
|
|
|
478
478
|
return `已扣除 ${totalPrice} P 点,${modelSeed}`
|
|
479
479
|
}
|
|
480
480
|
|
|
481
|
-
function buildGenerationReply(session, { successCount, count, failures, notes = []
|
|
482
|
-
const reply = []
|
|
483
|
-
if (
|
|
484
|
-
if (
|
|
485
|
-
|
|
486
|
-
return reply.filter(Boolean).join('\n')
|
|
481
|
+
function buildGenerationReply(session, { successCount, count, failures, notes = [] }) {
|
|
482
|
+
const reply = []
|
|
483
|
+
if (notes.length) reply.push(notes.join('\n'))
|
|
484
|
+
if (failures.length) reply.push(session.text('.batch-partial', [successCount, count, failures.length, failures.join(';')]))
|
|
485
|
+
return reply.filter(Boolean).join('\n')
|
|
487
486
|
}
|
|
488
487
|
|
|
489
488
|
async function sendNotices(session, notices, opts = {}) {
|
|
@@ -1492,10 +1491,12 @@ exports.apply = async function apply(ctx, cfg) {
|
|
|
1492
1491
|
// 发图:合并转发,不引用原指令
|
|
1493
1492
|
await sendImagesAsForward(session, forwardOutputs)
|
|
1494
1493
|
|
|
1495
|
-
|
|
1494
|
+
await sendNotices(session, [chargeNotice])
|
|
1495
|
+
|
|
1496
|
+
return buildGenerationReply(session, { successCount, count, failures, notes })
|
|
1496
1497
|
}
|
|
1497
1498
|
|
|
1498
|
-
// ---------------- 权限 ----------------
|
|
1499
|
+
// ---------------- 权限 ----------------
|
|
1499
1500
|
function readableOptimizeReason(reason) {
|
|
1500
1501
|
if (!reason) return ''
|
|
1501
1502
|
if (reason === 'llm_not_configured') return '(未配置 LLM 模型名或接口地址)'
|
|
@@ -2020,8 +2021,10 @@ exports.apply = async function apply(ctx, cfg) {
|
|
|
2020
2021
|
// 发图:合并转发,不引用原指令
|
|
2021
2022
|
await sendImagesAsForward(session, forwardOutputs)
|
|
2022
2023
|
|
|
2023
|
-
|
|
2024
|
-
|
|
2024
|
+
await sendNotices(session, [chargeNotice])
|
|
2025
|
+
|
|
2026
|
+
return buildGenerationReply(session, { successCount, count, failures })
|
|
2027
|
+
}
|
|
2025
2028
|
// ---------------- 提示词优化券交互式确认 ----------------
|
|
2026
2029
|
// 仅全局优化关闭 + 非管理员 + 已配置 LLM(tokenOpt 分支)时进入。
|
|
2027
2030
|
// 返回:{ cancelled, tokenUsedCount, perImageOptimize, noOptimizeReason }
|