minor tweak
This commit is contained in:
@@ -61,8 +61,8 @@ func (b *Bkosmi) Connect() error {
|
||||
b.roomID = roomID
|
||||
b.Log.Infof("Extracted room ID: %s", b.roomID)
|
||||
|
||||
// Create Native client (Playwright establishes WebSocket, we control it directly)
|
||||
b.client = NewNativeClient(b.roomURL, b.roomID, b.Log)
|
||||
// Create GraphQL WebSocket client (pure Go, no Playwright!)
|
||||
b.client = NewGraphQLWSClient(b.roomURL, b.roomID, b.Log)
|
||||
|
||||
// Register message handler
|
||||
b.client.OnMessage(b.handleIncomingMessage)
|
||||
@@ -198,8 +198,11 @@ func extractRoomID(url string) (string, error) {
|
||||
matches := re.FindStringSubmatch(url)
|
||||
if len(matches) >= 2 {
|
||||
roomID := matches[1]
|
||||
// Remove @ prefix if present (Kosmi uses both formats)
|
||||
return strings.TrimPrefix(roomID, "@"), nil
|
||||
// Ensure @ prefix is present (required for WebSocket API)
|
||||
if !strings.HasPrefix(roomID, "@") {
|
||||
roomID = "@" + roomID
|
||||
}
|
||||
return roomID, nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user