ronami_core/payloads/send_audio.rs
1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{
6 BusinessConnectionId, CallbackQueryId, EffectId, InputFile, Message, MessageEntity, ParseMode,
7 Recipient, ReplyMarkup, ReplyParameters, SuggestedPostParameters, ThreadId, TopicId, UserId,
8};
9
10impl_payload! {
11 @[multipart = audio, thumbnail]
12 /// Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent [`Message`] is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
13 ///
14 /// For sending voice messages, use the [`SendVoice`] method instead.
15 ///
16 /// [`Message`]: crate::types::Message
17 /// [`SendVoice`]: crate::payloads::SendVoice
18 #[derive(Debug, Clone, Serialize)]
19 pub SendAudio (SendAudioSetters) => Message {
20 required {
21 /// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
22 pub chat_id: Recipient [into],
23 /// Audio file to send. Pass a file_id as FileId to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. [More info on Sending Files »]
24 ///
25 /// [More info on Sending Files »]: crate::types::InputFile
26 pub audio: InputFile,
27 }
28 optional {
29 /// Unique identifier of the business connection on behalf of which the message will be sent
30 pub business_connection_id: BusinessConnectionId,
31 /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
32 pub message_thread_id: ThreadId,
33 /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
34 pub direct_messages_topic_id: TopicId,
35 /// Audio caption, 0-1024 characters after entities parsing
36 pub caption: String [into],
37 /// Mode for parsing entities in the audio caption. See [formatting options] for more details.
38 ///
39 /// [formatting options]: https://core.telegram.org/bots/api#formatting-options
40 pub parse_mode: ParseMode,
41 /// List of special entities that appear in the photo caption, which can be specified instead of _parse\_mode_
42 pub caption_entities: Vec<MessageEntity> [collect],
43 /// Duration of the audio in seconds
44 pub duration: u32,
45 /// Performer
46 pub performer: String [into],
47 /// Track name
48 pub title: String [into],
49 /// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. [More info on Sending Files »]
50 ///
51 /// [More info on Sending Files »]: crate::types::InputFile
52 pub thumbnail: InputFile,
53 /// Sends the message [silently]. Users will receive a notification with no sound.
54 ///
55 /// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
56 pub disable_notification: bool,
57 /// Protects the contents of sent messages from forwarding and saving
58 pub protect_content: bool,
59 /// 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
60 pub allow_paid_broadcast: bool,
61 /// Unique identifier of the message effect to be added to the message; for private chats only
62 pub message_effect_id: EffectId,
63 /// 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.
64 pub suggested_post_parameters: SuggestedPostParameters,
65 /// Identifier of the user who received the message
66 pub receiver_user_id: UserId,
67 /// Unique identifier of the query to be answered
68 pub callback_query_id: CallbackQueryId,
69 /// Description of the message to reply to
70 pub reply_parameters: ReplyParameters,
71 /// 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.
72 ///
73 /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
74 /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards
75 pub reply_markup: ReplyMarkup [into],
76 }
77 }
78}