MS Bot Framework: Is There a Command to Open an URL?

Viewed 1576

I can open an URL by tapping on a suggested action:

const msg = new builder.Message(session)
    .text('Open URL')
    .suggestedActions(
        builder.SuggestedActions.create(
            session, [
                builder.CardAction.openUrl(session, url, title),
            ]));

I can also open an URL using a Hero Card:

const card = new builder.HeroCard(session)
    .text('Open URL')
    .buttons([
        builder.CardAction.openUrl(session, url, title),
    ]);

But: Can I open an URL without the help of a button? I need to open an URL when a specific step of my dialog is reached and I'm looking for sth. like

session.openUrl(url);

Any idea if this is possible?

1 Answers

You can only pull this off if you use your own Chat application with the direct line api for example. With a web chat element it may also be possible but I wouldn't know how.

For any regular chat application (Facebook, Skype, ...) this is not possible. A bot is only supposed to send content back to the user after a message is received. To open an url, user-interaction is required. This is why you have to use the Card-actions.

This also works as a security so bots can't take user unwillingly to another website.

Related