Botpress interactions within Teams
# 🤝help
b
Hello, I am building a bot that at some point needs the user to enter their email address. This bot should get integrated within Teams, so I wondered if the bot could be able to get the email address of the user through teams (Getting the team's email address) so that the user don't have to fill it themselves. I didn't work on the Teams integration yet so I have no idea how the bot comunicate with teams if at all ? Thank you for your help !
a
Hey @bulky-dusk-45106, typically info from the channel is stored in
event.tags
. I don't know the exact location, but you can use the "JSON" tab on the bottom panel to inspect an incoming message from Teams and see all the info available there.
b
Thanks a lot !
Hey @acceptable-kangaroo-64719, right now, I am trying to see if I can get infos from event.tags using console.log() inside a hook. As for inspecting the JSON tab I don't think I understand. The JSON tab is only available inside the studio right ? So I can't inspect it when using teams since it only return informations about the emulator, or did I misunderstand ?
a
That's correct. Your console.log() in a hook should display the right info, though in a different place. Back in the main admin dashboard, you can view a bot's logs. Anything printed by the hook would show up there.
b
Yep, I was able to test that and I get some informations from Teams. Sadly, no email and I'm not exactly sure how to exploit those informations, but that's outside the scope of Botpress. Thanks for the help!
a
back in BP 12, we used this action to get user info from teams. A lot of the Botpress side is no longer valid, but the MS part might be helpful https://github.com/botpress/solutions/blob/master/custom%20solutions/Get%20user%20profile%20from%20Teams/actions/get-teams-email.js
b
I will look into that, thanks a lot !
a
Good luck!