dsh-bili-scroll 0.1.6 → 0.1.7

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 (4) hide show
  1. package/client.js +22 -0
  2. package/index.js +1347 -1296
  3. package/package.json +1 -1
  4. package/prompts/duty.md +37 -1
package/client.js CHANGED
@@ -148,6 +148,8 @@ window.__ModuleLoader__.load({
148
148
  const [perDay, setPerDay] = React.useState(null)
149
149
  const [perRound, setPerRound] = React.useState(null)
150
150
  const [replyPer, setReplyPer] = React.useState(null)
151
+ const [dmUid, setDmUid] = React.useState(null) // 私信收件人 UID(本地草稿)
152
+ const [dmMode, setDmMode] = React.useState(null) // 投递方式:off / only / both
151
153
  const [mention, setMention] = React.useState(null)
152
154
  const [login, setLogin] = React.useState(null)
153
155
  const [runNote, setRunNote] = React.useState(null)
@@ -172,6 +174,8 @@ window.__ModuleLoader__.load({
172
174
  if (cfg && perRound === null) setPerRound(String(cfg.commentPerRound ?? 1))
173
175
  if (cfg && replyPer === null) setReplyPer(String(cfg.replyPerRound ?? 1))
174
176
  if (cfg && mention === null) setMention(cfg.mentionName || '')
177
+ if (cfg && dmUid === null) setDmUid(cfg.dmUid ? String(cfg.dmUid) : '')
178
+ if (cfg && dmMode === null) setDmMode(cfg.dmMode || 'off')
175
179
  }, [cfg])
176
180
 
177
181
  const win = { ...DEFAULT_WINDOWS, ...(st?.windows || {}) }
@@ -440,6 +444,24 @@ window.__ModuleLoader__.load({
440
444
  onBlur: () => { const v = String(mention || '').trim(); setMention(v); patch({ mentionName: v }, '要 @ 谁') },
441
445
  }),
442
446
  h('div', { 'data-bd-note': '' }, '留空的话它就不发评论了 —— 因为评论存在的意义就是 @ 那一下')) : null,
447
+ h('div', { 'data-bd-label': '' }, '投递方式(评论 还是 私信)'),
448
+ h('select', {
449
+ 'data-bd-input': '', value: dmMode ?? 'off',
450
+ onChange: (e) => { setDmMode(e.target.value); patch({ dmMode: e.target.value }, '投递方式') },
451
+ },
452
+ h('option', { value: 'off' }, '只发评论 —— 在视频下面 @ 你(默认)'),
453
+ h('option', { value: 'only' }, '只私信 —— 一条公开评论都不发,最不打扰别人'),
454
+ h('option', { value: 'both' }, '评论 + 私信 —— 两边都发')),
455
+ (dmMode && dmMode !== 'off') ? h('div', { 'data-bd-sub': '' },
456
+ h('div', { 'data-bd-label': '' }, '私信发给谁(B站 UID,数字)'),
457
+ h('input', {
458
+ 'data-bd-input': '', 'data-bd-num': '', type: 'number', min: 0, value: dmUid ?? '',
459
+ placeholder: '对方的数字 UID;比如你自己的另一个号',
460
+ onChange: (e) => setDmUid(e.target.value),
461
+ onBlur: () => { const n = Math.max(0, Number(dmUid) || 0); setDmUid(n ? String(n) : ''); patch({ dmUid: n }, '私信收件人') },
462
+ }),
463
+ h('div', { 'data-bd-note': '' }, '私信内容 = 本轮每条的「标题 + 链接 + 一句话」,一轮合并成一条发(不受 150 字限制)'),
464
+ h('div', { 'data-bd-note': '' }, '⚠️ 建议先让这个号和收件人互关:B站 对「陌生人私信」会限流,还可能不弹提醒')) : null,
443
465
  h(ToggleRow, {
444
466
  label: '本地转写没字幕的视频',
445
467
  note: '默认关;开了以后,没字幕的视频会在本机转写一遍(不花 API 钱)',