Struct tgbot::types::SendChatAction
source · pub struct SendChatAction { /* private fields */ }
Expand description
Tells a user that something is happening on a bot side.
A status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status).
Example: The ImageBot needs some time to process a request and upload the image.
Instead of sending a text message along the lines of “Retrieving image, please wait…”,
the bot may use SendChatAction
with ChatAction::UploadPhoto
.
The user will see a “sending photo” status for the bot.
We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
Implementations§
source§impl SendChatAction
impl SendChatAction
sourcepub fn new<T>(chat_id: T, action: ChatAction) -> Self
pub fn new<T>(chat_id: T, action: ChatAction) -> Self
Creates a new SendChatAction
.
§Arguments
chat_id
- The unique identifier of the target chat.action
- The type of action to broadcast.
sourcepub fn with_business_connection_id<T>(self, value: T) -> Self
pub fn with_business_connection_id<T>(self, value: T) -> Self
Sets a new business connection ID.
§Arguments
value
- Unique identifier of the business connection on behalf of which the action will be sent.
sourcepub fn with_message_thread_id(self, value: Integer) -> Self
pub fn with_message_thread_id(self, value: Integer) -> Self
Sets a new message thread ID.
§Arguments
value
- Unique identifier of the target message thread; supergroups only.
Trait Implementations§
source§impl Clone for SendChatAction
impl Clone for SendChatAction
source§fn clone(&self) -> SendChatAction
fn clone(&self) -> SendChatAction
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SendChatAction
impl Debug for SendChatAction
source§impl Method for SendChatAction
impl Method for SendChatAction
Auto Trait Implementations§
impl Freeze for SendChatAction
impl RefUnwindSafe for SendChatAction
impl Send for SendChatAction
impl Sync for SendChatAction
impl Unpin for SendChatAction
impl UnwindSafe for SendChatAction
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more