use crate::Client;
use crate::errors::Result;
use crate::raw::{base, functions};
#[must_use = "a request does nothing until it is awaited"]
pub struct GetBotShortDescription<'a> {
client: &'a Client,
language_code: String,
}
impl Client {
pub fn get_bot_short_description(&self) -> GetBotShortDescription<'_> {
GetBotShortDescription { client: self, language_code: String::new() }
}
}
impl GetBotShortDescription<'_> {
pub fn language_code(mut self, language_code: impl Into<String>) -> Self {
self.language_code = language_code.into();
self
}
async fn send(self) -> Result<String> {
let request = functions::bots::GetBotInfo { bot: None, lang_code: self.language_code };
let base::bots::BotInfo::BotInfo(info) = self.client.invoke(&request).await?;
Ok(info.about)
}
}
into_future!(GetBotShortDescription, String);