botman / botman/driver-botframework

'from' details missing when sending responses to Bot Framework

Open
#18 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
9
Forks
10
PR merge metrics
No merged PRs in 30d

Description

I've not gotten as far as trying this with Microsoft teams but I've setup a new copy of Botman Studio with the Bot Framework driver and am testing it with the Bot Framework Emulator.

So using the out of the box routes and such, I'm getting a 400 response from the callback being sent to the emulator when sending the message "Hi" from the emulator. I'm expecting botman to reply with "Hello!"

>{
> "error": {
> "code": "ServiceError",
> "message": "Cannot read property 'name' of undefined"
> }
>}

It looks like the payload being sent is missing fields.

Botman is sending the following payload as a response which results in the 400 from the emulator
> {"payload":{"type":"message","text":"Hello!"}}

Manually adding a from the id and bot name to the payload within the buildServicePayload method allows the message to be received

```
$additionalParameters = [
'from' => [
'name' => 'Bot',
'id' => '*ID*FROM*REQUEST*',
],
];
```

Payload sent to callback url
> {"payload":{"type":"message","from":{"name":"Bot","id":"*ID*FROM*REQUEST*"},"text":"Hello!"}}

I'm fairly new to BotMan so not familiar enough with the flow of everything to fix this yet.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.