samira
samira

Reputation: 118

How can send the telegram bot location to users?

I want to send location of the bot to users, I very searched about it in google , but i find just this case"send location of users to the bot" I want versa case that mean:"send location of the bot to the users". this is my idea: the owner of the bot is a driver who that want to share his location with the users of the bot,in the bot i put a button,when the users click on that button, the bot tell them location of driver.the location of bot is variable and it isn't constant

Upvotes: 3

Views: 22048

Answers (3)

Ilkay Solotov
Ilkay Solotov

Reputation: 73

use sendLocation and not a web request to telegram api, to get the longitude and latitude you can use messageEventArgs.Message.Location.Latitude and messageEventArgs.Message.Location.Longitude with telegram c# bot api

Upvotes: 0

H.T
H.T

Reputation: 130

Sample request for send location from Bot to user with URL:

https://api.telegram.org/bot[botToken]/sendlocation?chat_id=[UserID]&latitude=51.6680&longitude=32.6546

Requirement for execute URL:

[botToken], e.g:399684XXX:AAH_NiVFtLXVmh4XXX-XXXEZo3yO6XXX

[UserID], e.g:64326XX

latitude , e.g:51.6680
longitude, e.g:32.6546

Upvotes: 3

Sean Wei
Sean Wei

Reputation: 7975

You can use sendVenue or sendLocation method to do it.

Upvotes: 2

Related Questions