Skip to content

Commit 4e40414

Browse files
986912: resolved Liquid syntax error
1 parent 222fe30 commit 4e40414

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

blazor/chat-ui/bot-integrations/integration-with-bot-framework.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Use the `MessageSend`event of the `SfChatUI` component to handle message exchang
125125
Create or modify a Razor component (e.g., `Pages/Chat.razor`) to integrate the Syncfusion Chat UI with the Direct Line API:
126126

127127
{% tabs %}
128-
{% highlight razor %}
128+
{% highlight cshtml %}
129129

130130
@using Syncfusion.Blazor.InteractiveChat
131131
@using Syncfusion.Blazor
@@ -172,7 +172,7 @@ Create or modify a Razor component (e.g., `Pages/Chat.razor`) to integrate the S
172172

173173
// Use JSInterop to initialize Direct Line (client-side for real-time updates)
174174
var directLine = await JS.InvokeAsync<IJSObjectReference>("eval",
175-
$"new BotFramework.DirectLine.DirectLine({{ token: '{data.token}' }})");
175+
`new BotFramework.DirectLine.DirectLine({ token: '${data.token}' })`);
176176

177177
isConnected = true;
178178

@@ -181,14 +181,14 @@ Create or modify a Razor component (e.g., `Pages/Chat.razor`) to integrate the S
181181
}
182182
catch (Exception ex)
183183
{
184-
await ChatUI.AddMessageAsync(new ChatMessage { Text = "Sorry, I couldnt connect to the bot.", Author = BotUserModel });
184+
await ChatUI.AddMessageAsync(new ChatMessage { Text = "Sorry, I couldn't connect to the bot.", Author = BotUserModel });
185185
Console.WriteLine($"Connection error: {ex.Message}");
186186
return;
187187
}
188188
}
189189

190190
// Send message to bot via JSInterop
191-
await JS.InvokeVoidAsync("sendToBot", /* directLine ref or global */, args.Message.Text, currentUserId);
191+
await JS.InvokeVoidAsync("sendToBot", directLine, args.Message.Text, currentUserId);
192192
args.Cancel = true; // Prevent default send
193193
}
194194

0 commit comments

Comments
 (0)