MessageBuilder

Struct MessageBuilder 

Source
pub struct MessageBuilder { /* private fields */ }
Expand description

Builder for the Message structure

Implementations§

Source§

impl MessageBuilder

Source

pub fn new(message_id: i64, date: i64, chat: Chat) -> Self

Instantiate the builder with the fields message_id, message_thread_id, from, sender_chat, date, chat, forward_from, forward_from_chat, forward_from_message_id, forward_signature, forward_sender_name, forward_date, is_topic_message, is_automatic_forward, reply_to_message, via_bot, edit_date, has_protected_content, media_group_id, author_signature, text, entities, animation, audio, document, photo, sticker, video, video_note, voice, caption, caption_entities, has_media_spoiler, contact, dice, game, poll, venue, location, new_chat_members, left_chat_member, new_chat_title, new_chat_photo, delete_chat_photo, group_chat_created, supergroup_chat_created, channel_chat_created, message_auto_delete_timer_changed, migrate_to_chat_id, migrate_from_chat_id, pinned_message, invoice, successful_payment, connected_website, write_access_allowed, passport_data, proximity_alert_triggered, forum_topic_created, forum_topic_edited, forum_topic_closed, forum_topic_reopened, general_forum_topic_hidden, general_forum_topic_unhidden, video_chat_scheduled, video_chat_started, video_chat_ended, video_chat_participants_invited, web_app_data, reply_markup

Source

pub fn message_thread_id(self, val: i64) -> Self

Set the field message_thread_id to the given value

Source

pub fn from(self, val: User) -> Self

Set the field from to the given value

Source

pub fn sender_chat(self, val: Box<Chat>) -> Self

Set the field sender_chat to the given value

Source

pub fn forward_from(self, val: User) -> Self

Set the field forward_from to the given value

Source

pub fn forward_from_chat(self, val: Box<Chat>) -> Self

Set the field forward_from_chat to the given value

Source

pub fn forward_from_message_id(self, val: i64) -> Self

Set the field forward_from_message_id to the given value

Source

pub fn forward_signature(self, val: String) -> Self

Set the field forward_signature to the given value

Source

pub fn forward_sender_name(self, val: String) -> Self

Set the field forward_sender_name to the given value

Source

pub fn forward_date(self, val: i64) -> Self

Set the field forward_date to the given value

Source

pub fn is_topic_message(self, val: i64) -> Self

Set the field is_topic_message to the given value

Source

pub fn is_automatic_forward(self, val: bool) -> Self

Set the field is_automatic_forward to the given value

Source

pub fn reply_to_message(self, val: Box<Message>) -> Self

Set the field reply_to_message to the given value

Source

pub fn via_bot(self, val: User) -> Self

Set the field via_bot to the given value

Source

pub fn edit_date(self, val: i64) -> Self

Set the field edit_date to the given value

Source

pub fn has_protected_content(self, val: bool) -> Self

Set the field has_protected_content to the given value

Source

pub fn media_group_id(self, val: String) -> Self

Set the field media_group_id to the given value

Source

pub fn author_signature(self, val: String) -> Self

Set the field author_signature to the given value

Source

pub fn text(self, val: String) -> Self

Set the field text to the given value

Source

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

Set the field entities to the given value

Source

pub fn animation(self, val: Animation) -> Self

Set the field animation to the given value

Source

pub fn audio(self, val: Audio) -> Self

Set the field audio to the given value

Source

pub fn document(self, val: Document) -> Self

Set the field document to the given value

Source

pub fn photo(self, val: Vec<PhotoSize>) -> Self

Set the field photo to the given value

Source

pub fn sticker(self, val: Sticker) -> Self

Set the field sticker to the given value

Source

pub fn video(self, val: Video) -> Self

Set the field video to the given value

Source

pub fn video_note(self, val: VideoNote) -> Self

Set the field video_note to the given value

Source

pub fn voice(self, val: Voice) -> Self

Set the field voice to the given value

Source

pub fn caption(self, val: String) -> Self

Set the field caption to the given value

Source

pub fn caption_entities(self, val: Vec<MessageEntity>) -> Self

Set the field caption_entities to the given value

Source

pub fn has_media_spoiler(self, val: bool) -> Self

Set the field has_media_spoiler to the given value

Source

pub fn contact(self, val: Contact) -> Self

Set the field contact to the given value

Source

pub fn dice(self, val: Dice) -> Self

Set the field dice to the given value

Source

pub fn game(self, val: Game) -> Self

Set the field game to the given value

Source

pub fn poll(self, val: Poll) -> Self

Set the field poll to the given value

Source

pub fn venue(self, val: Venue) -> Self

Set the field venue to the given value

Source

pub fn location(self, val: Location) -> Self

Set the field location to the given value

Source

pub fn new_chat_members(self, val: Vec<User>) -> Self

Set the field new_chat_members to the given value

Source

pub fn left_chat_member(self, val: User) -> Self

Set the field left_chat_member to the given value

Source

pub fn new_chat_title(self, val: String) -> Self

Set the field new_chat_title to the given value

Source

pub fn new_chat_photo(self, val: Vec<PhotoSize>) -> Self

Set the field new_chat_photo to the given value

Source

pub fn delete_chat_photo(self, val: bool) -> Self

Set the field delete_chat_photo to the given value

Source

pub fn group_chat_created(self, val: bool) -> Self

Set the field group_chat_created to the given value

Source

pub fn supergroup_chat_created(self, val: bool) -> Self

Set the field supergroup_chat_created to the given value

Source

pub fn channel_chat_created(self, val: bool) -> Self

Set the field channel_chat_created to the given value

Source

pub fn message_auto_delete_timer_changed( self, val: MessageAutoDeleteTimerChanged, ) -> Self

Set the field message_auto_delete_timer_changed to the given value

Source

pub fn migrate_to_chat_id(self, val: i64) -> Self

Set the field migrate_to_chat_id to the given value

Source

pub fn migrate_from_chat_id(self, val: i64) -> Self

Set the field migrate_from_chat_id to the given value

Source

pub fn pinned_message(self, val: Box<Message>) -> Self

Set the field pinned_message to the given value

Source

pub fn invoice(self, val: Invoice) -> Self

Set the field invoice to the given value

Source

pub fn successful_payment(self, val: SuccessfulPayment) -> Self

Set the field successful_payment to the given value

Source

pub fn connected_website(self, val: String) -> Self

Set the field connected_website to the given value

Source

pub fn write_access_allowed(self, val: WriteAccessAllowed) -> Self

Set the field write_access_allowed to the given value

Source

pub fn passport_data(self, val: PassportData) -> Self

Set the field passport_data to the given value

Source

pub fn proximity_alert_triggered(self, val: ProximityAlertTriggered) -> Self

Set the field proximity_alert_triggered to the given value

Source

pub fn forum_topic_created(self, val: ForumTopicCreated) -> Self

Set the field forum_topic_created to the given value

Source

pub fn forum_topic_edited(self, val: ForumTopicEdited) -> Self

Set the field forum_topic_edited to the given value

Source

pub fn forum_topic_closed(self, val: ForumTopicClosed) -> Self

Set the field forum_topic_closed to the given value

Source

pub fn forum_topic_reopened(self, val: ForumTopicReopened) -> Self

Set the field forum_topic_reopened to the given value

Source

pub fn general_forum_topic_hidden(self, val: GeneralForumTopicHidden) -> Self

Set the field general_forum_topic_hidden to the given value

Source

pub fn general_forum_topic_unhidden( self, val: GeneralForumTopicUnhidden, ) -> Self

Set the field general_forum_topic_unhidden to the given value

Source

pub fn video_chat_scheduled(self, val: VideoChatScheduled) -> Self

Set the field video_chat_scheduled to the given value

Source

pub fn video_chat_started(self, val: VideoChatStarted) -> Self

Set the field video_chat_started to the given value

Source

pub fn video_chat_ended(self, val: VideoChatEnded) -> Self

Set the field video_chat_ended to the given value

Source

pub fn video_chat_participants_invited( self, val: VideoChatParticipantsInvited, ) -> Self

Set the field video_chat_participants_invited to the given value

Source

pub fn web_app_data(self, val: WebAppData) -> Self

Set the field web_app_data to the given value

Source

pub fn reply_markup(self, val: InlineKeyboardMarkup) -> Self

Set the field reply_markup to the given value

Trait Implementations§

Source§

impl Builder for MessageBuilder

Source§

type Value = Message

Type to be built
Source§

fn build(self) -> <MessageBuilder as Builder>::Value

Converts the builder into the built value

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,