EditMessageText

Struct EditMessageText 

Source
pub struct EditMessageText {
    pub chat_id: ChatId,
    pub message_id: i64,
    pub text: String,
    pub parse_mode: Option<ParseMode>,
    pub entities: Option<Vec<MessageEntity>>,
    pub disable_web_page_preview: Option<bool>,
    pub reply_markup: Option<InlineKeyboardMarkup>,
}
Expand description

Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

Fields§

§chat_id: ChatId

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

§message_id: i64

Identifier of the message to edit

§text: String

New text of the message, 1-4096 characters after entities parsing

§parse_mode: Option<ParseMode>

Mode for parsing entities in the message text. See formatting options for more details.

§entities: Option<Vec<MessageEntity>>

List of special entities that appear in message text, which can be specified instead of parse_mode

§disable_web_page_preview: Option<bool>

Disables link previews for links in the sent message

§reply_markup: Option<InlineKeyboardMarkup>

A JSON-serialized object for a new inline keyboard.

Implementations§

Source§

impl EditMessageText

Source

pub fn new( chat_id: impl Into<ChatId>, message_id: i64, text: impl Into<String>, ) -> Self

Create a new editMessageText request

Source

pub fn with_parse_mode(self, parse_mode: ParseMode) -> Self

Set parse mode

Source

pub fn with_entities(self, entities: Vec<MessageEntity>) -> Self

Set entities

Source

pub fn with_entity(self, entity: MessageEntity) -> Self

Add one entity

Source

pub fn disable_web_page_preview(self) -> Self

Disable web preview

Source

pub fn with_reply_markup(self, markup: impl Into<InlineKeyboardMarkup>) -> Self

Set reply markup

Trait Implementations§

Source§

impl Clone for EditMessageText

Source§

fn clone(&self) -> EditMessageText

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Serialize for EditMessageText

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TelegramMethod for EditMessageText

Source§

type Response = Message

Source§

fn name() -> &'static str

Source§

impl JsonMethod for EditMessageText

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.