mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 07:25:36 +01:00
This commit is contained in:
@@ -134,25 +134,14 @@ async fn _send_downloaded_file(
|
||||
.into_async_read()
|
||||
.compat();
|
||||
|
||||
let document: InputFile = InputFile::read(data).file_name(filename.clone());
|
||||
let document = InputFile::read(data).file_name(filename.clone());
|
||||
|
||||
match bot
|
||||
.send_document(message.chat().id, document)
|
||||
bot.send_document(message.chat().id, document)
|
||||
.caption(caption)
|
||||
.send()
|
||||
.await
|
||||
{
|
||||
Ok(_) => (),
|
||||
Err(err) => {
|
||||
log::error!("Download error: {filename:?} | {err:?}");
|
||||
return Err(err.into());
|
||||
}
|
||||
}
|
||||
.await?;
|
||||
|
||||
match send_donation_notification(bot, message.clone()).await {
|
||||
Ok(_) => (),
|
||||
Err(err) => log::error!("{err:?}"),
|
||||
};
|
||||
send_donation_notification(bot, message.clone()).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -24,10 +24,7 @@ pub enum RegisterRequestStatus {
|
||||
async fn get_bot_username(token: &str) -> Option<String> {
|
||||
match Bot::new(token).get_me().send().await {
|
||||
Ok(v) => v.username.clone(),
|
||||
Err(err) => {
|
||||
log::error!("Bot reg (getting username) error: {err:?}");
|
||||
None
|
||||
}
|
||||
Err(_) => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user