Skip to content

Commit 1a91492

Browse files
authored
Go SDK support for chat messages. (#1147)
1 parent 7313a81 commit 1a91492

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.changeset/go-sdk-chat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"github.com/livekit/protocol": patch
3+
---
4+
5+
Go SDK support for chat messages.

livekit/types.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,3 +319,12 @@ func applyMapDiff(dst *map[string]string, diff map[string]string) {
319319
}
320320
*dst = m
321321
}
322+
323+
// ToProto implements DataPacket in Go SDK.
324+
func (p *ChatMessage) ToProto() *DataPacket {
325+
return &DataPacket{
326+
Value: &DataPacket_ChatMessage{
327+
ChatMessage: p,
328+
},
329+
}
330+
}

0 commit comments

Comments
 (0)