Skip to main content

teloxide_core/payloads/
send_location.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{
6    BusinessConnectionId, EffectId, EphemeralMessageParameters, LivePeriod, Message, Recipient,
7    ReplyMarkup, ReplyParameters, SuggestedPostParameters, ThreadId, TopicId,
8};
9
10impl_payload! {
11    /// Use this method to send point on the map. On success, the sent [`Message`] is returned.
12    ///
13    /// [`Message`]: crate::types::Message
14    #[derive(Debug, PartialEq, Clone, Serialize)]
15    pub SendLocation (SendLocationSetters) => Message {
16        required {
17            /// Latitude of the location
18            pub latitude: f64,
19            /// Longitude of the location
20            pub longitude: f64,
21        }
22        optional {
23            /// Unique identifier of the business connection on behalf of which the message will be sent
24            pub business_connection_id: BusinessConnectionId,
25            /// Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format `@username`; required unless the message is sent as an ephemeral reply to a callback query
26            pub chat_id: Recipient [into],
27            /// A JSON-serialized object containing the parameters of the ephemeral message to send
28            pub ephemeral_message_parameters: EphemeralMessageParameters,
29            /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
30            pub message_thread_id: ThreadId,
31            /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
32            pub direct_messages_topic_id: TopicId,
33            /// The radius of uncertainty for the location, measured in meters; 0-1500
34            pub horizontal_accuracy: f64,
35            /// Period in seconds for which the location will be updated (see [Live Locations], should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.
36            ///
37            /// [Live Locations]: https://telegram.org/blog/live-locations
38            pub live_period: LivePeriod,
39            /// For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
40            pub heading: u16,
41            /// For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
42            pub proximity_alert_radius: u32,
43            /// Sends the message [silently]. Users will receive a notification with no sound.
44            ///
45            /// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
46            pub disable_notification: bool,
47            /// Protects the contents of sent messages from forwarding and saving
48            pub protect_content: bool,
49            /// Pass `true` to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
50            pub allow_paid_broadcast: bool,
51            /// Unique identifier of the message effect to be added to the message; for private chats only
52            pub message_effect_id: EffectId,
53            /// An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
54            pub suggested_post_parameters: SuggestedPostParameters,
55            /// Description of the message to reply to
56            pub reply_parameters: ReplyParameters,
57            /// Additional interface options. A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account.
58            ///
59            /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
60            /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards
61            pub reply_markup: ReplyMarkup [into],
62        }
63    }
64}