Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding custom data to channel data. #1430

Closed
ssong3k opened this issue Dec 3, 2018 · 3 comments · Fixed by #1331
Closed

Adding custom data to channel data. #1430

ssong3k opened this issue Dec 3, 2018 · 3 comments · Fixed by #1331

Comments

@ssong3k
Copy link

ssong3k commented Dec 3, 2018

Since the webchat has migrated to V4 I have not found any documentation to add custom data into messages using the embedded webchat.

My sample originally used the following code.

const speechOptions = {
    speechRecognizer: new BotChat.Speech.BrowserSpeechRecognizer(),
    speechSynthesizer: new BotChat.Speech.BrowserSpeechSynthesizer()
}

var dl = new BotChat.DirectLine({ secret: 'YOUR_SECRET_HERE' });

BotChat.App({
    botConnection: Object.assign({}, dl, {
        postActivity: activity => {
            var newActivity = Object.assign({}, activity, { ChannelData: { 'Channel': 'WebChat'} });
            return dl.postActivity(newActivity);
        }
    }),
    user: { id: 'userid' },
    bot: { id: 'botid' },
    resize: 'window',
    speechOptions: speechOptions
}, document.getElementById("bot"));

Is there anyway to do something similar along the above line for V4?

@compulim
Copy link
Contributor

compulim commented Dec 3, 2018

We are building a sample and it is currently in PR #1331, got approved but need time to merge it in.

In short, we updated a line of production code to make the sample looks smoother. It should be in within days. Stay tuned!

@ssong3k
Copy link
Author

ssong3k commented Dec 3, 2018

Ah that's good to know I'm currently updating some older demos to match the new framework. Can I also ask if there is anyway to preserve the layout of the V3 UI? The V4 embedded webchat with window.WebChat.RenderWebChat does not having the input box fixed to the bottom of the div. I've been playing with CSS but it seems the way the divs are nested makes my approach much more difficult.

To give an idea of what I mean.
v3

v4

@ssong3k
Copy link
Author

ssong3k commented Dec 3, 2018

That should be a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants