mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 15:01:45 +01:00
commit
95dc6e5881
21 changed files with 54 additions and 8 deletions
|
@ -15,7 +15,7 @@
|
|||
<img src="https://img.shields.io/badge/license-MIT-blue.svg">
|
||||
</a>
|
||||
<a href="https://core.telegram.org/bots/api">
|
||||
<img src="https://img.shields.io/badge/API%20coverage-Up%20to%205.3%20(inclusively)-green.svg">
|
||||
<img src="https://img.shields.io/badge/API%20coverage-Up%20to%205.6%20(inclusively)-green.svg">
|
||||
</a>
|
||||
<a href="https://crates.io/crates/teloxide_core">
|
||||
<img src="https://img.shields.io/crates/v/teloxide_core.svg">
|
||||
|
|
|
@ -37,6 +37,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -29,6 +29,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -51,6 +51,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -35,6 +35,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -27,6 +27,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -44,6 +44,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -27,6 +27,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -72,6 +72,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -39,6 +39,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -27,6 +27,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -35,6 +35,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -38,6 +38,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -53,6 +53,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -30,6 +30,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -43,6 +43,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -51,6 +51,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -39,6 +39,8 @@ impl_payload! {
|
|||
///
|
||||
/// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
|
||||
pub disable_notification: bool,
|
||||
/// Protects the contents of sent messages from forwarding and saving
|
||||
pub protect_content: bool,
|
||||
/// If the message is a reply, ID of the original message
|
||||
pub reply_to_message_id: i32,
|
||||
/// Pass _True_, if the message should be sent even if the specified replied-to message is not found
|
||||
|
|
|
@ -64,6 +64,7 @@ pub enum MessageEntityKind {
|
|||
TextMention { user: User },
|
||||
Underline,
|
||||
Strikethrough,
|
||||
Spoiler,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
@ -12,13 +12,20 @@ use serde::{Deserialize, Serialize};
|
|||
/// Formatting options.
|
||||
///
|
||||
/// The Bot API supports basic formatting for messages. You can use bold,
|
||||
/// italic, underlined and strikethrough text, as well as inline links and
|
||||
/// pre-formatted code in your bots' messages. Telegram clients will render
|
||||
/// italic, underlined, strikethrough, and spoiler text, as well as inline links
|
||||
/// and pre-formatted code in your bots' messages. Telegram clients will render
|
||||
/// them accordingly. You can use either markdown-style or HTML-style
|
||||
/// formatting.
|
||||
///
|
||||
/// Note that Telegram clients will display an **alert** to the user before
|
||||
/// opening an inline link (‘Open this link?’ together with the full URL).
|
||||
/// opening an inline link ('Open this link?' together with the full URL).
|
||||
///
|
||||
/// Message entities can be nested, providing following restrictions are met:
|
||||
/// - If two entities have common characters then one of them is fully contained
|
||||
/// inside another.
|
||||
/// - bold, italic, underline, strikethrough, and spoiler entities can contain
|
||||
/// and can be part of any other entities, except pre and code.
|
||||
/// - All other entities can't contain each other.
|
||||
///
|
||||
/// Links `tg://user?id=<user_id>` can be used to mention a user by their ID
|
||||
/// without using a username. Please note:
|
||||
|
@ -39,7 +46,8 @@ use serde::{Deserialize, Serialize};
|
|||
/// _italic \*text_
|
||||
/// __underline__
|
||||
/// ~strikethrough~
|
||||
/// *bold _italic bold ~italic bold strikethrough~ __underline italic bold___ bold*
|
||||
/// ||spoiler||
|
||||
/// *bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic bold___ bold*
|
||||
/// [inline URL](http://www.example.com/)
|
||||
/// [inline mention of a user](tg://user?id=123456789)
|
||||
/// `inline fixed-width code`
|
||||
|
@ -77,9 +85,10 @@ use serde::{Deserialize, Serialize};
|
|||
/// <i>italic</i>, <em>italic</em>
|
||||
/// <u>underline</u>, <ins>underline</ins>
|
||||
/// <s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del>
|
||||
/// <b>bold <i>italic bold <s>italic bold strikethrough</s> <u>underline italic bold</u></i> bold</b>
|
||||
/// <a href="http:// www.example.com/">inline URL</a>
|
||||
/// <a href="tg:// user?id=123456789">inline mention of a user</a>
|
||||
/// <span class="tg-spoiler">spoiler</span>, <tg-spoiler>spoiler</tg-spoiler>
|
||||
/// <b>bold <i>italic bold <s>italic bold strikethrough <span class="tg-spoiler">italic bold strikethrough spoiler</span></s> <u>underline italic bold</u></i> bold</b>
|
||||
/// <a href="http://www.example.com/">inline URL</a>
|
||||
/// <a href="tg://user?id=123456789">inline mention of a user</a>
|
||||
/// <code>inline fixed-width code</code>
|
||||
/// <pre>pre-formatted fixed-width code block</pre>
|
||||
#[doc = "<pre><code class=\"language-rust\">pre-formatted fixed-width code block written in the \
|
||||
|
|
Loading…
Reference in a new issue