pub struct GetUpdates {
pub offset: Option<i64>,
pub limit: Option<u8>,
pub timeout: Option<i64>,
pub allowed_updates: Option<Box<[Box<str>]>>,
}Expand description
Use this method to receive incoming updates using long polling (wiki). Returns an Array of Update objects.
§Documentation
https://core.telegram.org/bots/api#getupdates
§Returns
Box<[crate::Either<crate::types::Update,crate::types::UpdateUnparsed>]>
Fields§
§offset: Option<i64>Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as crate::methods::GetUpdates is called with an offset higher than its update_id. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All previous updates will be forgotten.
limit: Option<u8>Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.
timeout: Option<i64>Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.
allowed_updates: Option<Box<[Box<str>]>>A JSON-serialized list of the update types you want your bot to receive. For example, specify message, edited_channel_post, callback_query to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used. Please note that this parameter doesn’t affect updates created before the call to crate::methods::GetUpdates, so unwanted updates may be received for a short period of time.
Implementations§
Source§impl GetUpdates
impl GetUpdates
Sourcepub fn offset<T: Into<i64>>(self, val: T) -> Self
pub fn offset<T: Into<i64>>(self, val: T) -> Self
Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as crate::methods::GetUpdates is called with an offset higher than its update_id. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All previous updates will be forgotten.
Sourcepub fn offset_option<T: Into<i64>>(self, val: Option<T>) -> Self
pub fn offset_option<T: Into<i64>>(self, val: Option<T>) -> Self
Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as crate::methods::GetUpdates is called with an offset higher than its update_id. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All previous updates will be forgotten.
Sourcepub fn limit<T: Into<u8>>(self, val: T) -> Self
pub fn limit<T: Into<u8>>(self, val: T) -> Self
Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.
Sourcepub fn limit_option<T: Into<u8>>(self, val: Option<T>) -> Self
pub fn limit_option<T: Into<u8>>(self, val: Option<T>) -> Self
Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.
Sourcepub fn timeout<T: Into<i64>>(self, val: T) -> Self
pub fn timeout<T: Into<i64>>(self, val: T) -> Self
Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.
Sourcepub fn timeout_option<T: Into<i64>>(self, val: Option<T>) -> Self
pub fn timeout_option<T: Into<i64>>(self, val: Option<T>) -> Self
Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.
Sourcepub fn allowed_updates<TItem: Into<Box<str>>, T: IntoIterator<Item = TItem>>(
self,
val: T,
) -> Self
pub fn allowed_updates<TItem: Into<Box<str>>, T: IntoIterator<Item = TItem>>( self, val: T, ) -> Self
A JSON-serialized list of the update types you want your bot to receive. For example, specify message, edited_channel_post, callback_query to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used. Please note that this parameter doesn’t affect updates created before the call to crate::methods::GetUpdates, so unwanted updates may be received for a short period of time.
§Notes
Adds multiple elements.
Sourcepub fn allowed_update<T: Into<Box<str>>>(self, val: T) -> Self
pub fn allowed_update<T: Into<Box<str>>>(self, val: T) -> Self
A JSON-serialized list of the update types you want your bot to receive. For example, specify message, edited_channel_post, callback_query to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used. Please note that this parameter doesn’t affect updates created before the call to crate::methods::GetUpdates, so unwanted updates may be received for a short period of time.
§Notes
Adds a single element.
Sourcepub fn allowed_updates_option<TItem: Into<Box<str>>, T: IntoIterator<Item = TItem>>(
self,
val: Option<T>,
) -> Self
pub fn allowed_updates_option<TItem: Into<Box<str>>, T: IntoIterator<Item = TItem>>( self, val: Option<T>, ) -> Self
A JSON-serialized list of the update types you want your bot to receive. For example, specify message, edited_channel_post, callback_query to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used. Please note that this parameter doesn’t affect updates created before the call to crate::methods::GetUpdates, so unwanted updates may be received for a short period of time.
§Notes
Adds multiple elements.
Trait Implementations§
Source§impl Clone for GetUpdates
impl Clone for GetUpdates
Source§fn clone(&self) -> GetUpdates
fn clone(&self) -> GetUpdates
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more