koishi-plugin-p-draw 1.5.1 → 1.5.2

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.
Files changed (3) hide show
  1. package/index.js +16 -8
  2. package/package.json +1 -1
  3. package/readme.md +1 -1
package/index.js CHANGED
@@ -474,14 +474,22 @@ exports.apply = async function apply(ctx, cfg) {
474
474
  return reply.filter(Boolean).join('\n')
475
475
  }
476
476
 
477
- async function sendNotices(session, notices, opts = {}) {
478
- const content = notices.filter(Boolean).join('\n')
479
- if (!content) return
480
- try {
481
- const message = opts.quote && session.messageId ? h.quote(session.messageId) + content : content
482
- await session.send(message)
483
- } catch (e) {
484
- logger.warn(`发送反馈消息失败:${e.message}`)
477
+ async function sendNotices(session, notices, opts = {}) {
478
+ const content = notices.filter(Boolean).join('\n')
479
+ if (!content) return
480
+ try {
481
+ const quoteId = session.event?.message?.id || session.messageId
482
+ let message = content
483
+ if (opts.quote && quoteId) {
484
+ const quote = session.platform === 'onebot'
485
+ ? h('reply', { id: quoteId })
486
+ : h.quote(quoteId)
487
+ message = quote + content
488
+ }
489
+ if (cfg.outputLogs && opts.quote) logger.info(`[p-draw] 发送扣费引用通知 platform=${session.platform || 'unknown'} messageId=${quoteId || 'missing'}`)
490
+ await session.send(message)
491
+ } catch (e) {
492
+ logger.warn(`发送反馈消息失败:${e.message}`)
485
493
  }
486
494
  }
487
495
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-p-draw",
3
3
  "description": "p点-绘图,连接本地 ComfyUI 生图。支持自然语言优化、尺寸选择、画师组、固定角色、生成队列,需要配合 p-qiandao 使用",
4
- "version": "1.5.1",
4
+ "version": "1.5.2",
5
5
  "main": "index.js",
6
6
  "files": [
7
7
  "index.js",
package/readme.md CHANGED
@@ -20,7 +20,7 @@ p点-绘图插件,连接本地 ComfyUI 生图,参考 AstrBot 的 [anima 绘
20
20
  - 生成队列(逐张顺序执行,防止争抢 GPU)。
21
21
  - `p-draw 状态` 查看 ComfyUI 连接状态与模型可用性。
22
22
  - `p-draw help`(或 `帮助`)查看全部指令帮助,包含生成 / 多人 / 批量张数 / 尺寸 / 画师组 / 状态等。
23
- - 发图时会以合并转发发送,每张图片后附对应的 Positive / Negative 提示词;扣费提醒单独引用触发指令,并显示实际模型和 seed(如 `已扣除 750 P 点,当前模型:animagine-xl-3.1.safetensors,--seed=123456`)。
23
+ - 发图时会以合并转发发送,每张图片后附对应的 Positive / Negative 提示词;扣费提醒单独引用触发指令,并显示实际模型和 seed(如 `已扣除 750 P 点,当前模型:animagine-xl-3.1.safetensors,--seed=123456`)。OneBot/NapCat 自动使用原生 `reply` 消息段发送引用。
24
24
 
25
25
  ## 安装
26
26