Skip to main content

teloxide_core/payloads/
send_contact.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{
6    BusinessConnectionId, EffectId, EphemeralMessageParameters, Message, Recipient, ReplyMarkup,
7    ReplyParameters, SuggestedPostParameters, ThreadId, TopicId,
8};
9
10impl_payload! {
11    /// Use this method to send phone contacts. On success, the sent [`Message`] is returned.
12    ///
13    /// [`Message`]: crate::types::Message
14    #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
15    pub SendContact (SendContactSetters) => Message {
16        required {
17            /// Contact's phone number
18            pub phone_number: String [into],
19            /// Contact's first name
20            pub first_name: String [into],
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            /// Contact's last name
34            pub last_name: String [into],
35            /// Additional data about the contact in the form of a [vCard], 0-2048 bytes
36            ///
37            /// [vCard]: https://en.wikipedia.org/wiki/VCard
38            pub vcard: String [into],
39            /// Sends the message [silently]. Users will receive a notification with no sound.
40            ///
41            /// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
42            pub disable_notification: bool,
43            /// Protects the contents of sent messages from forwarding and saving
44            pub protect_content: bool,
45            /// 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
46            pub allow_paid_broadcast: bool,
47            /// Unique identifier of the message effect to be added to the message; for private chats only
48            pub message_effect_id: EffectId,
49            /// 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.
50            pub suggested_post_parameters: SuggestedPostParameters,
51            /// Description of the message to reply to
52            pub reply_parameters: ReplyParameters,
53            /// 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.
54            ///
55            /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
56            /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards
57            pub reply_markup: ReplyMarkup [into],
58        }
59    }
60}