MCPcopy Index your code
hub / github.com/python-telegram-bot/python-telegram-bot / send_location

Method send_location

src/telegram/_bot.py:2991–3152  ·  view source on GitHub ↗

Use this method to send point on the map. Note: You can either supply a :paramref:`latitude` and :paramref:`longitude` or a :paramref:`location`. Args: chat_id (:obj:`int` | :obj:`str`): |chat_id_channel| latitude (:obj:`float`, optio

(
        self,
        chat_id: int | str,
        latitude: float | None = None,
        longitude: float | None = None,
        disable_notification: ODVInput[bool] = DEFAULT_NONE,
        reply_markup: "ReplyMarkup | None" = None,
        live_period: TimePeriod | None = None,
        horizontal_accuracy: float | None = None,
        heading: int | None = None,
        proximity_alert_radius: int | None = None,
        protect_content: ODVInput[bool] = DEFAULT_NONE,
        message_thread_id: int | None = None,
        reply_parameters: "ReplyParameters | None" = None,
        business_connection_id: str | None = None,
        message_effect_id: str | None = None,
        allow_paid_broadcast: bool | None = None,
        direct_messages_topic_id: int | None = None,
        suggested_post_parameters: "SuggestedPostParameters | None" = None,
        *,
        allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
        reply_to_message_id: int | None = None,
        location: "Location | None" = None,
        read_timeout: ODVInput[float] = DEFAULT_NONE,
        write_timeout: ODVInput[float] = DEFAULT_NONE,
        connect_timeout: ODVInput[float] = DEFAULT_NONE,
        pool_timeout: ODVInput[float] = DEFAULT_NONE,
        api_kwargs: JSONDict | None = None,
    )

Source from the content-addressed store, hash-verified

2989 return Message.de_list(result, self)
2990
2991 async def send_location(
2992 self,
2993 chat_id: int | str,
2994 latitude: float | None = None,
2995 longitude: float | None = None,
2996 disable_notification: ODVInput[bool] = DEFAULT_NONE,
2997 reply_markup: "ReplyMarkup | None" = None,
2998 live_period: TimePeriod | None = None,
2999 horizontal_accuracy: float | None = None,
3000 heading: int | None = None,
3001 proximity_alert_radius: int | None = None,
3002 protect_content: ODVInput[bool] = DEFAULT_NONE,
3003 message_thread_id: int | None = None,
3004 reply_parameters: "ReplyParameters | None" = None,
3005 business_connection_id: str | None = None,
3006 message_effect_id: str | None = None,
3007 allow_paid_broadcast: bool | None = None,
3008 direct_messages_topic_id: int | None = None,
3009 suggested_post_parameters: "SuggestedPostParameters | None" = None,
3010 *,
3011 allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
3012 reply_to_message_id: int | None = None,
3013 location: "Location | None" = None,
3014 read_timeout: ODVInput[float] = DEFAULT_NONE,
3015 write_timeout: ODVInput[float] = DEFAULT_NONE,
3016 connect_timeout: ODVInput[float] = DEFAULT_NONE,
3017 pool_timeout: ODVInput[float] = DEFAULT_NONE,
3018 api_kwargs: JSONDict | None = None,
3019 ) -> Message:
3020 """Use this method to send point on the map.
3021
3022 Note:
3023 You can either supply a :paramref:`latitude` and :paramref:`longitude` or a
3024 :paramref:`location`.
3025
3026 Args:
3027 chat_id (:obj:`int` | :obj:`str`): |chat_id_channel|
3028 latitude (:obj:`float`, optional): Latitude of location.
3029 longitude (:obj:`float`, optional): Longitude of location.
3030 horizontal_accuracy (:obj:`int`, optional): The radius of uncertainty for the location,
3031 measured in meters;
3032 0-:tg-const:`telegram.constants.LocationLimit.HORIZONTAL_ACCURACY`.
3033 live_period (:obj:`int` | :class:`datetime.timedelta`, optional): Period in seconds for
3034 which the location will be
3035 updated, should be between
3036 :tg-const:`telegram.constants.LocationLimit.MIN_LIVE_PERIOD` and
3037 :tg-const:`telegram.constants.LocationLimit.MAX_LIVE_PERIOD`, or
3038 :tg-const:`telegram.constants.LocationLimit.LIVE_PERIOD_FOREVER` for live
3039 locations that can be edited indefinitely.
3040
3041 .. versionchanged:: 21.11
3042 |time-period-input|
3043 heading (:obj:`int`, optional): For live locations, a direction in which the user is
3044 moving, in degrees. Must be between
3045 :tg-const:`telegram.constants.LocationLimit.MIN_HEADING` and
3046 :tg-const:`telegram.constants.LocationLimit.MAX_HEADING` if specified.
3047 proximity_alert_radius (:obj:`int`, optional): For live locations, a maximum distance
3048 for proximity alerts about approaching another chat member, in meters. Must be

Calls 1

_send_messageMethod · 0.95