How to get user's location while chatting with bots?
Asked Answered
C

4

8

I am developing a Bot Framework application that integrates with Slack using Microsoft Bot technology. In the bot project, I was trying to get the user location when the user sends a message.

What I am trying to achieve is that, when a user types the message "Show me nearby hospitals", I want to get the users Geo coordinates and pass them to an API that will return a list of hospitals near that location. So any idea on how to get the user's current location in the Microsoft Bot project?

I tried using the Geo location class, however I am not able to add the class reference directly and when I add the external DLL for the Geo location class, Visual Studio throws some errors.

Is there any way to get the users current location in Bots?

Chasidychasing answered 17/5, 2016 at 6:8 Comment(0)
C
1

The Bot Framework is getting updated every minute!!!

The Bing location control for Microsoft Bot Framework makes the process of collecting and validating the user’s desired location in a conversation easy and reliable.

The control is available for C# and Node.js and works consistently across all channels supported by Bot Framework.

Check the documentation here.

Click to view the code sample

Coaction answered 14/3, 2017 at 20:12 Comment(0)
B
1

This question is old but this is now a thing that exists to help with location hope it will help someone looking for this answer. https://github.com/Microsoft/BotBuilder-Location

Baillieu answered 31/5, 2017 at 22:12 Comment(0)
S
0

Channels vary on whether they support location information. There is currently no way to get location information for users on Slack. Telegram, for instance, does. When location data is available it will returned in the Attachment data structure and in the channel's native format in the ChannelData field. Note that the user needs to opt into sending this data (to protect their privacy). The bot developer can send a message to the user requesting that they share their location data, but they cannot get it from the channel it w/o user action to share it.

Seymour answered 19/5, 2016 at 19:22 Comment(0)
I
0

This is currently not handled by the BotBuilder well. I've opened an issue to get this standardize across platforms. Regarding Slack, they don't have an option to send a location as an attachment as Telegram, Messenger and Kik do, so you might want to use Google Geocode API to derive coordinates from a string.

Isolt answered 22/5, 2016 at 19:53 Comment(1)
which obviously is not a legal solution as google has mentioned in its terms of service that you cannot use geocoding services unless you have a map being displayedMagnetohydrodynamics

© 2022 - 2024 — McMap. All rights reserved.