yz-yuki-plugin 2.0.6-5 → 2.0.6-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.
@@ -62,5 +62,9 @@ splitHeight: 8000
62
62
  # 直播动态是否@全体成员,默认 0 关闭,1 开启。开启前请检查 <机器人> 是否有 [管理员权限] 或 [聊天平台是否支持],某些聊天平台或类型不支持@全体成员,如qq官方机器人等。
63
63
  liveAtAll: 0
64
64
 
65
+ # 直播动态@全体成员的群组/聊天/私聊列表,默认为空即不在任何群于推送直播动态中执行@全体成员。开启liveAtAll后才会生效。
66
+ liveAtAllGroupList:
67
+ - 1234567890 # 示例群号
68
+
65
69
  # 直播动态@全体成员的共享冷却时间CD,单位秒,默认 1800 秒(30分钟),即每个群聊30分钟内不论多少条直播动态,只会@一次。注意,qq群有 @全体成员 10次/日 的限制,所以请合理设置。
66
70
  liveAtAllCD: 1800
@@ -175,6 +175,7 @@ class BiliTask {
175
175
  let liveAtAll = biliConfigData.liveAtAll === true ? true : false; // 直播动态是否@全体成员,默认false
176
176
  let liveAtAllCD = biliConfigData.liveAtAllCD || 1800; // 直播动态@全体成员 冷却时间CD,默认 30 分钟
177
177
  let liveAtAllMark = await Redis.get(`${markKey}${chatId}:liveAtAllMark`); // 直播动态@全体成员标记,默认 0
178
+ let liveAtAllGroupList = new Set(Array.isArray(biliConfigData.liveAtAllGroupList) ? biliConfigData.liveAtAllGroupList : []); // 直播动态@全体成员的群组列表,默认空数组,为空则不进行@全体成员操作
178
179
  if (!!biliConfigData.pushMsgMode) {
179
180
  const { data, uid } = await BiliQuery.formatDynamicData(pushDynamicData); // 处理动态数据
180
181
  const extentData = { ...data };
@@ -206,7 +207,7 @@ class BiliTask {
206
207
  return;
207
208
  Redis.set(`${markKey}${chatId}:${id_str}`, '1', { EX: 3600 * 72 }); // 设置已发送标记
208
209
  global?.logger?.mark('优纪插件:B站动态执行推送');
209
- if (liveAtAll && liveAtAllMark && extentData?.type === 'DYNAMIC_TYPE_LIVE_RCMD') {
210
+ if (liveAtAll && liveAtAllMark && extentData?.type === 'DYNAMIC_TYPE_LIVE_RCMD' && liveAtAllGroupList.has(chatId)) {
210
211
  try {
211
212
  await this.sendMessage(chatId, bot_id, chatType, Segment.at('all'));
212
213
  await Redis.set(`${markKey}${chatId}:liveAtAllMark`, 1, { EX: liveAtAllCD }); // 设置直播动态@全体成员标记为 1
@@ -239,7 +240,7 @@ class BiliTask {
239
240
  let mergeTextPic = !!biliConfigData.mergeTextPic === false ? false : true; // 是否合并文本和图片,默认为 true
240
241
  if (mergeTextPic) {
241
242
  const mergeMsg = [...dynamicMsg.msg, ...dynamicMsg.pics];
242
- if (liveAtAll && liveAtAllMark && dynamicMsg.dynamicType === 'DYNAMIC_TYPE_LIVE_RCMD') {
243
+ if (liveAtAll && liveAtAllMark && dynamicMsg.dynamicType === 'DYNAMIC_TYPE_LIVE_RCMD' && liveAtAllGroupList.has(chatId)) {
243
244
  try {
244
245
  await this.sendMessage(chatId, bot_id, chatType, Segment.at('all'));
245
246
  await Redis.set(`${markKey}${chatId}:liveAtAllMark`, 1, { EX: liveAtAllCD }); // 设置直播动态@全体成员标记为 1
@@ -252,7 +253,7 @@ class BiliTask {
252
253
  await this.sendMessage(chatId, bot_id, chatType, mergeMsg);
253
254
  }
254
255
  else {
255
- if (liveAtAll && liveAtAllMark && dynamicMsg.dynamicType === 'DYNAMIC_TYPE_LIVE_RCMD') {
256
+ if (liveAtAll && liveAtAllMark && dynamicMsg.dynamicType === 'DYNAMIC_TYPE_LIVE_RCMD' && liveAtAllGroupList.has(chatId)) {
256
257
  try {
257
258
  await this.sendMessage(chatId, bot_id, chatType, Segment.at('all'));
258
259
  await Redis.set(`${markKey}${chatId}:liveAtAllMark`, 1, { EX: liveAtAllCD }); // 设置直播动态@全体成员标记为 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yz-yuki-plugin",
3
- "version": "2.0.6-5",
3
+ "version": "2.0.6-6",
4
4
  "description": "优纪插件,yunzaijs 关于 微博推送、B站推送 等功能的拓展插件",
5
5
  "author": "snowtafir",
6
6
  "type": "module",