question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is the activating a chat bot by the directLine postActivity best practice?

See original GitHub issue

🚨 The issue tracker is not for implementation questions 🚨

[Question] I guess this is a couple questions about activating a chat bot once the client enters the endpoint of the chatbot? Upon using the renderChatBot webchat api and creating a directLine instance a directLine.postActivity() method can be fired off to initiate the bot so if there is a welcome card it will trigger and introduce itself to the end-user.

Is posting an event like this best practice? Is there a more official, alternative and or better way of doing this? I ask because in the example below it is an event that is fired off but what about a message and text event. Does username and name even matter for anything useful in terms of the chatbot?

Ultimately, to fire off the bot is using the postActivity the only way of really achieving this?

 directLine
                .postActivity({
                    from: { id: this.userId, name: "USER_NAME" },
                    name: "requestWelcomeDialog",
                    type: "event",
                    value: "token"
                })
                .subscribe(
                    id => console.log(`Posted activity, assigned ID ${id}`),
                    error => console.log(`Error posting activity ${error}`)
                );

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
tdurnfordcommented, Aug 7, 2019
1reaction
xtianus79commented, Aug 7, 2019

@tdurnford Yes, exactly what I was wondering lol you always have those exact answers. @compulim just to ask there’s no real reason in a production bot to go beyond that initial post activity for a back-channel event starter? Wanted to confirm that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connect a bot to Direct Line - Azure - Microsoft Learn
Learn how to configure bots to communicate with client ... The best practice is to use the Direct Line API to exchange the...
Read more >
sending a message to bot: v3 directline.postActivity vs. v4 ...
It isn't documented anywhere, but best practice is what is demonstrated via the samples, by use of the Web Chat redux store and...
Read more >
Third-Party Bots — Introduction - LivePerson Developer Center
Microsoft provides different ways to implement chat bots like the Bot Framework SDK. A good starting point is the documentation on Azure Bot...
Read more >
Using the Direct Line API to communicate with your Bot ...
Start a conversation with the chatbot; Send a message to the ... we send it to our bot using the Direct Line Clients...
Read more >
Activate or Deactivate Your Bot - Salesforce Help
When you're ready to put your bot to work, activate your bot and welcome your new agent to the team!Required Editions and User...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found