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()
|
.into_async_read()
|
||||||
.compat();
|
.compat();
|
||||||
|
|
||||||
let document: InputFile = InputFile::read(data).file_name(filename.clone());
|
let document = InputFile::read(data).file_name(filename.clone());
|
||||||
|
|
||||||
match bot
|
bot.send_document(message.chat().id, document)
|
||||||
.send_document(message.chat().id, document)
|
|
||||||
.caption(caption)
|
.caption(caption)
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await?;
|
||||||
{
|
|
||||||
Ok(_) => (),
|
|
||||||
Err(err) => {
|
|
||||||
log::error!("Download error: {filename:?} | {err:?}");
|
|
||||||
return Err(err.into());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
match send_donation_notification(bot, message.clone()).await {
|
send_donation_notification(bot, message.clone()).await?;
|
||||||
Ok(_) => (),
|
|
||||||
Err(err) => log::error!("{err:?}"),
|
|
||||||
};
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,7 @@ pub enum RegisterRequestStatus {
|
|||||||
async fn get_bot_username(token: &str) -> Option<String> {
|
async fn get_bot_username(token: &str) -> Option<String> {
|
||||||
match Bot::new(token).get_me().send().await {
|
match Bot::new(token).get_me().send().await {
|
||||||
Ok(v) => v.username.clone(),
|
Ok(v) => v.username.clone(),
|
||||||
Err(err) => {
|
Err(_) => None,
|
||||||
log::error!("Bot reg (getting username) error: {err:?}");
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user