Skip to main content

Bot

Struct Bot 

Source
pub struct Bot {
Show 13 fields pub first_name: String, pub id: Integer, pub username: String, pub allows_users_to_create_topics: bool, pub can_connect_to_business: bool, pub can_join_groups: bool, pub can_manage_bots: bool, pub can_read_all_group_messages: bool, pub has_main_web_app: bool, pub has_topics_enabled: bool, pub last_name: Option<String>, pub supports_guest_queries: bool, pub supports_inline_queries: bool,
}
Expand description

Represents information about a bot returned in GetBot.

Fields§

§first_name: String

The first name of the bot.

§id: Integer

The unique identifier for the bot.

§username: String

The username of the bot.

§allows_users_to_create_topics: bool

Whether the bot allows users to create and delete topics in private chats.

§can_connect_to_business: bool

Whether the bot can be connected to a Telegram Business account to receive its messages.

§can_join_groups: bool

Indicates whether the bot can be invited to groups.

§can_manage_bots: bool

Whether other bots can be created to be controlled by the bot.

§can_read_all_group_messages: bool

Indicates whether privacy mode is disabled, allowing the bot to read all group messages.

§has_main_web_app: bool

Indicates whether the bot has a main Web App.

§has_topics_enabled: bool

Indicates whether the bot has forum topic mode enabled in private chats.

§last_name: Option<String>

The last name of the bot.

§supports_guest_queries: bool

Indicates whether the bot supports guest queries from chats it is not a member of.

§supports_inline_queries: bool

Indicates whether the bot supports inline queries.

Implementations§

Source§

impl Bot

Source

pub fn new<A, B>(id: Integer, username: A, first_name: B) -> Self
where A: Into<String>, B: Into<String>,

Creates a new Bot.

§Arguments
  • id - The unique identifier for the bot.
  • username - The username of the bot.
  • first_name - The first name of the bot.
Source

pub fn with_allows_users_to_create_topics(self, value: bool) -> Self

Sets a new value for the allows_users_to_create_topics flag.

§Arguments
  • value - Whether the bot allows users to create and delete topics in private chats.
Source

pub fn with_can_connect_to_business(self, value: bool) -> Self

Sets a new value for the can_connect_to_business flag.

§Arguments
  • value - Whether the bot can be connected to a Telegram Business account.
Source

pub fn with_can_join_groups(self, value: bool) -> Self

Sets a new value for the can_join_groups flag.

§Arguments
  • value - Indicates whether the bot can be invited to groups.
Source

pub fn with_can_manage_bots(self, value: bool) -> Self

Sets a new value for the can_manage_bots flag.

§Arguments
  • value - Whether other bots can be created to be controlled by the bot.
Source

pub fn with_can_read_all_group_messages(self, value: bool) -> Self

Sets a new value for the can_read_all_group_messages flag.

§Arguments
  • value - Indicates whether privacy mode is disabled.
Source

pub fn with_has_main_web_app(self, value: bool) -> Self

Sets a new value for the has_main_web_app flag.

§Arguments
  • value - Indicates whether the bot has a main Web App.
Source

pub fn with_has_topics_enabled(self, value: bool) -> Self

Sets a new value for the has_topics_enabled flag.

§Arguments
  • value - Indicates whether the bot has forum topic mode enabled in private chats.
Source

pub fn with_last_name<T>(self, value: T) -> Self
where T: Into<String>,

Sets a new value for the last name of the bot.

§Arguments
  • value - The last name of the bot.
Source

pub fn with_supports_guest_queries(self, value: bool) -> Self

Sets a new value for the supports_guest_queries flag.

§Arguments
  • value - Indicates whether the bot supports guest queries.
Source

pub fn with_supports_inline_queries(self, value: bool) -> Self

Sets a new value for the supports_inline_queries flag.

§Arguments
  • value - Indicates whether the bot supports inline queries.

Trait Implementations§

Source§

impl Clone for Bot

Source§

fn clone(&self) -> Bot

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Bot

Source§

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

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

impl<'de> Deserialize<'de> for Bot

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 Bot

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Bot

Source§

fn partial_cmp(&self, other: &Bot) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for Bot

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 Bot

Auto Trait Implementations§

§

impl Freeze for Bot

§

impl RefUnwindSafe for Bot

§

impl Send for Bot

§

impl Sync for Bot

§

impl Unpin for Bot

§

impl UnsafeUnpin for Bot

§

impl UnwindSafe for Bot

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> 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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.
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,