mirror of
https://github.com/xfgryujk/blivechat.git
synced 2025-03-13 19:30:46 +08:00
额外通过内容来判断是否是礼物弹幕
This commit is contained in:
parent
39ab15e1ac
commit
dae5f782db
frontend/src/api/chat
@ -174,7 +174,7 @@ export default class ChatClientDirectOpenLive extends ChatClientOfficialBase {
|
|||||||
authorType: authorType,
|
authorType: authorType,
|
||||||
content: data.msg,
|
content: data.msg,
|
||||||
privilegeType: data.guard_level,
|
privilegeType: data.guard_level,
|
||||||
isGiftDanmaku: false,
|
isGiftDanmaku: chat.isGiftDanmakuByContent(data.msg),
|
||||||
authorLevel: 1,
|
authorLevel: 1,
|
||||||
isNewbie: false,
|
isNewbie: false,
|
||||||
isMobileVerified: true,
|
isMobileVerified: true,
|
||||||
|
@ -90,14 +90,15 @@ export default class ChatClientDirectWeb extends ChatClientOfficialBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let authorName = info[2][1]
|
let authorName = info[2][1]
|
||||||
|
let content = info[1]
|
||||||
let data = {
|
let data = {
|
||||||
avatarUrl: await chat.getAvatarUrl(uid, authorName),
|
avatarUrl: await chat.getAvatarUrl(uid, authorName),
|
||||||
timestamp: info[0][4] / 1000,
|
timestamp: info[0][4] / 1000,
|
||||||
authorName: authorName,
|
authorName: authorName,
|
||||||
authorType: authorType,
|
authorType: authorType,
|
||||||
content: info[1],
|
content: content,
|
||||||
privilegeType: privilegeType,
|
privilegeType: privilegeType,
|
||||||
isGiftDanmaku: Boolean(info[0][9]),
|
isGiftDanmaku: Boolean(info[0][9]) || chat.isGiftDanmakuByContent(content),
|
||||||
authorLevel: info[4][0],
|
authorLevel: info[4][0],
|
||||||
isNewbie: info[2][5] < 10000,
|
isNewbie: info[2][5] < 10000,
|
||||||
isMobileVerified: Boolean(info[2][6]),
|
isMobileVerified: Boolean(info[2][6]),
|
||||||
|
@ -133,14 +133,15 @@ export default class ChatClientRelay {
|
|||||||
emoticon = contentTypeParams[0]
|
emoticon = contentTypeParams[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let content = data[4]
|
||||||
data = {
|
data = {
|
||||||
avatarUrl: data[0],
|
avatarUrl: data[0],
|
||||||
timestamp: data[1],
|
timestamp: data[1],
|
||||||
authorName: data[2],
|
authorName: data[2],
|
||||||
authorType: data[3],
|
authorType: data[3],
|
||||||
content: data[4],
|
content: content,
|
||||||
privilegeType: data[5],
|
privilegeType: data[5],
|
||||||
isGiftDanmaku: Boolean(data[6]),
|
isGiftDanmaku: Boolean(data[6]) || chat.isGiftDanmakuByContent(content),
|
||||||
authorLevel: data[7],
|
authorLevel: data[7],
|
||||||
isNewbie: Boolean(data[8]),
|
isNewbie: Boolean(data[8]),
|
||||||
isMobileVerified: Boolean(data[9]),
|
isMobileVerified: Boolean(data[9]),
|
||||||
|
@ -42,3 +42,32 @@ export async function getTextEmoticons() {
|
|||||||
}
|
}
|
||||||
return res.textEmoticons
|
return res.textEmoticons
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 开放平台接口不会发送是否是礼物弹幕,只能用内容判断了
|
||||||
|
const GIFT_DANMAKU_CONTENTS = new Set([
|
||||||
|
// 红包
|
||||||
|
'老板大气!点点红包抽礼物',
|
||||||
|
'老板大气!点点红包抽礼物!',
|
||||||
|
'点点红包,关注主播抽礼物~',
|
||||||
|
'喜欢主播加关注,点点红包抽礼物',
|
||||||
|
'红包抽礼物,开启今日好运!',
|
||||||
|
'中奖喷雾!中奖喷雾!',
|
||||||
|
// 节奏风暴
|
||||||
|
'前方高能预警,注意这不是演习',
|
||||||
|
'我从未见过如此厚颜无耻之人',
|
||||||
|
'那万一赢了呢',
|
||||||
|
'你们城里人真会玩',
|
||||||
|
'左舷弹幕太薄了',
|
||||||
|
'要优雅,不要污',
|
||||||
|
'我选择狗带',
|
||||||
|
'可爱即正义~~',
|
||||||
|
'糟了,是心动的感觉!',
|
||||||
|
'这个直播间已经被我们承包了!',
|
||||||
|
'妈妈问我为什么跪着看直播 w(゚Д゚)w',
|
||||||
|
'你们对力量一无所知~( ̄▽ ̄)~',
|
||||||
|
// 好像花式夸夸还有,不想花钱收集内容了
|
||||||
|
])
|
||||||
|
|
||||||
|
export function isGiftDanmakuByContent(content) {
|
||||||
|
return GIFT_DANMAKU_CONTENTS.has(content)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user