Reputation: 118
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
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
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