mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-09 03:43:22 +01:00
Fix doc test
This commit is contained in:
parent
84ac0212e8
commit
1882ff0bc4
1 changed files with 6 additions and 4 deletions
|
@ -17,16 +17,18 @@ impl Bot {
|
|||
/// ## Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// use teloxide_core::types::File as TgFile;
|
||||
/// use teloxide_core::{
|
||||
/// requests::{Request, Requester},
|
||||
/// types::File as TgFile,
|
||||
/// Bot,
|
||||
/// };
|
||||
/// use tokio::fs::File;
|
||||
/// # use teloxide_core::RequestError;
|
||||
/// use teloxide_core::{requests::RequestOld, Bot};
|
||||
///
|
||||
/// # async fn run() -> Result<(), Box<dyn std::error::Error>> {
|
||||
/// let bot = Bot::new("TOKEN");
|
||||
/// let mut file = File::create("/home/waffle/Pictures/test.png").await?;
|
||||
///
|
||||
/// let TgFile { file_path, .. } = bot.get_file("*file_id*").send().await?;
|
||||
/// let mut file = File::create("/home/waffle/Pictures/test.png").await?;
|
||||
/// bot.download_file(&file_path, &mut file).await?;
|
||||
/// # Ok(()) }
|
||||
/// ```
|
||||
|
|
Loading…
Reference in a new issue