Builder for location payloads.
This module provides a fluent API for sending geographic coordinates.
Examples
# Send location coordinates
ctx
|> Location.coordinates(40.7128, -74.0060)
|> Location.send(chat_id)
# Send location silently
ctx
|> Location.coordinates(55.7558, 37.6173)
|> Location.silent()
|> Location.send(chat_id)
Summary
Functions
Sets the geographic coordinates.
Sends the location to the specified chat.
Sends the location without notification sound.
Functions
Sets the geographic coordinates.
Parameters
ctx- Context maplat- Latitudelng- Longitude
Returns
Updated context map with coordinates set.
Examples
# New York City coordinates
ctx
|> Location.coordinates(40.7128, -74.0060)
|> Location.send(chat_id)
Sends the location to the specified chat.
Parameters
ctx- Context map with accumulated location dataid- Chat ID to send the location to
Returns
:ok- Location sent successfully{:error, reason}- Failed to send location
Sends the location without notification sound.
Parameters
ctx- Context map
Returns
Updated context map with silent flag set.