Skip to content

Commit 0f21ef5

Browse files
committed
feat: 醒目留言消息增加消息id返回
1 parent a4621aa commit 0f21ef5

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,9 @@ export type Handler = {
428428
type msgType = 'SUPER_CHAT_MESSAGE'
429429

430430
export interface SuperChatMsg {
431+
/** 消息id */
432+
id: number
433+
/** 发送用户 */
431434
user: User
432435
/** 弹幕内容 */
433436
content: string

src/parser/SUPER_CHAT_MESSAGE.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import type { Message, User } from '../types/app'
22

33
export interface SuperChatMsg {
4+
/** 消息id */
5+
id: number
6+
/** 发送用户 */
47
user: User
58
/** 弹幕内容 */
69
content: string
@@ -16,6 +19,7 @@ const parser = (data: any, roomId: number): SuperChatMsg => {
1619
const rawData = data.data
1720
const { medal_info, user_info } = data.data
1821
return {
22+
id: rawData.id,
1923
user: {
2024
uid: rawData.uid,
2125
uname: rawData.user_info.uname,

0 commit comments

Comments
 (0)