Enum tgbot::types::UpdateType

source ·
pub enum UpdateType {
Show 23 variants BotStatus(ChatMemberUpdated), BusinessConnection(BusinessConnection), BusinessMessage(Message), CallbackQuery(CallbackQuery), ChannelPost(Message), ChatBoostRemoved(ChatBoostRemoved), ChatBoostUpdated(ChatBoostUpdated), ChatJoinRequest(ChatJoinRequest), ChosenInlineResult(ChosenInlineResult), DeletedBusinessMessages(BusinessMessagesDeleted), EditedBusinessMessage(Message), EditedChannelPost(Message), EditedMessage(Message), InlineQuery(InlineQuery), Message(Message), MessageReaction(MessageReactionUpdated), MessageReactionCount(MessageReactionCountUpdated), Poll(Poll), PollAnswer(PollAnswer), PreCheckoutQuery(PreCheckoutQuery), ShippingQuery(ShippingQuery), UserStatus(ChatMemberUpdated), Unknown(Value),
}
Expand description

Represents a type of an update.

Variants§

§

BotStatus(ChatMemberUpdated)

The bot chat member status was updated in a chat.

For private chats, this update is received only when the bot is blocked or unblocked by the user.

§

BusinessConnection(BusinessConnection)

The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot.

§

BusinessMessage(Message)

New non-service message from a connected business account.

§

CallbackQuery(CallbackQuery)

A new incoming callback query.

§

ChannelPost(Message)

A new incoming channel post.

§

ChatBoostRemoved(ChatBoostRemoved)

A boost was removed from a chat.

The bot must be an administrator in the chat to receive these updates.

§

ChatBoostUpdated(ChatBoostUpdated)

A chat boost was added or changed.

The bot must be an administrator in the chat to receive these updates.

§

ChatJoinRequest(ChatJoinRequest)

A request to join the chat has been sent.

The bot must have the can_invite_users administrator right in the chat to receive these updates.

§

ChosenInlineResult(ChosenInlineResult)

The result of an inline query that was chosen by a user and sent to their chat partner.

Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.

§

DeletedBusinessMessages(BusinessMessagesDeleted)

Messages were deleted from a connected business account.

§

EditedBusinessMessage(Message)

New version of a message from a connected business account.

§

EditedChannelPost(Message)

A new version of a channel post that is known to the bot and was edited.

§

EditedMessage(Message)

A new version of a message that is known to the bot and was edited.

§

InlineQuery(InlineQuery)

A new incoming inline query.

§

Message(Message)

A new incoming message.

§

MessageReaction(MessageReactionUpdated)

A reaction to a message was changed by a user.

The bot must be an administrator in the chat and must explicitly specify AllowedUpdate::MessageReaction in the list of allowed_updates to receive these updates.

The update isn’t received for reactions set by bots.

§

MessageReactionCount(MessageReactionCountUpdated)

Reactions to a message with anonymous reactions were changed.

The bot must be an administrator in the chat and must explicitly specify AllowedUpdate::MessageReactionCount in the list of allowed_updates to receive these updates.

§

Poll(Poll)

A new poll state.

Bots receive only updates about polls, which are sent or stopped by the bot.

§

PollAnswer(PollAnswer)

A user changed their answer in a non-anonymous poll

Bots receive new votes only in polls that were sent by the bot itself.

§

PreCheckoutQuery(PreCheckoutQuery)

A new incoming pre-checkout query.

Contains full information about checkout

§

ShippingQuery(ShippingQuery)

A new incoming shipping query.

Only for invoices with flexible price.

§

UserStatus(ChatMemberUpdated)

A chat member’s status was updated in a chat.

The bot must be an administrator in the chat and must explicitly specify AllowedUpdate::UserStatus in the list of allowed_updates to receive these updates.

§

Unknown(Value)

Used for unknown update types.

For example, Telegram introduced a new update type, but tgbot does not support it.

Trait Implementations§

source§

impl Clone for UpdateType

source§

fn clone(&self) -> UpdateType

Returns a copy 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 Debug for UpdateType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for UpdateType

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for UpdateType

source§

fn eq(&self, other: &UpdateType) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for UpdateType

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 StructuralPartialEq for UpdateType

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> FromRef<T> for T
where T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

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

§

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>,

§

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>,

§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,