mirror of
https://github.com/shanmiteko/LotteryAutoScript.git
synced 2026-06-04 21:01:17 +08:00
fix: 官方抽奖判断未获取到内容 (#445)
Fixed #445 增加ditem?.modules?.module_dynamic?.major?.opus?.summary?.rich_text_nodes 判断
This commit is contained in:
parent
1832f6d52b
commit
f5f63bcc91
@ -103,6 +103,7 @@ function parseDynamicCard(data) {
|
||||
/* 转发描述 */
|
||||
obj.description = '';
|
||||
let _total_len = 0;
|
||||
if (Array.isArray(ditem?.modules?.module_dynamic?.desc?.rich_text_nodes)) {
|
||||
ditem?.modules?.module_dynamic?.desc?.rich_text_nodes.forEach(node => {
|
||||
if (node.type === 'RICH_TEXT_NODE_TYPE_AT') {
|
||||
obj.ctrl.push({
|
||||
@ -119,6 +120,24 @@ function parseDynamicCard(data) {
|
||||
obj.description += node.orig_text;
|
||||
_total_len += node.text.length;
|
||||
});
|
||||
} else {
|
||||
ditem?.modules?.module_dynamic?.major?.opus?.summary?.rich_text_nodes.forEach(node => {
|
||||
if (node.type === 'RICH_TEXT_NODE_TYPE_AT') {
|
||||
obj.ctrl.push({
|
||||
data: node.rid,
|
||||
location: _total_len,
|
||||
length: node.text.length,
|
||||
type: 1
|
||||
});
|
||||
}
|
||||
/* 是否有官方抽奖 */
|
||||
if (node.type === 'RICH_TEXT_NODE_TYPE_LOTTERY') {
|
||||
obj.hasOfficialLottery = true;
|
||||
}
|
||||
obj.description += node.orig_text;
|
||||
_total_len += node.text.length;
|
||||
});
|
||||
}
|
||||
/* 预约抽奖信息 */
|
||||
obj.reserve_id = ditem?.modules?.module_dynamic?.additional?.reserve?.rid || 0;
|
||||
obj.reserve_lottery_text = ditem?.modules?.module_dynamic?.additional?.reserve?.title || '信息丢失';
|
||||
@ -166,6 +185,7 @@ function parseDynamicCard(data) {
|
||||
obj.origin_hasOfficialLottery = false;
|
||||
/* 转发描述 */
|
||||
obj.origin_description = '';
|
||||
if (Array.isArray(ditem?.orig?.modules?.module_dynamic?.desc?.rich_text_nodes)) {
|
||||
ditem?.orig?.modules?.module_dynamic?.desc?.rich_text_nodes.forEach(node => {
|
||||
/* 是否有官方抽奖 */
|
||||
if (node.type === 'RICH_TEXT_NODE_TYPE_LOTTERY') {
|
||||
@ -173,6 +193,15 @@ function parseDynamicCard(data) {
|
||||
}
|
||||
obj.origin_description += node.orig_text;
|
||||
});
|
||||
} else {
|
||||
ditem?.orig.modules?.module_dynamic?.major?.opus?.summary?.rich_text_nodes.forEach(node => {
|
||||
/* 是否有官方抽奖 */
|
||||
if (node.type === 'RICH_TEXT_NODE_TYPE_LOTTERY') {
|
||||
obj.origin_hasOfficialLottery = true;
|
||||
}
|
||||
obj.origin_description += node.orig_text;
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
log.error('动态卡片解析', e);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user