mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-29 00:12:12 +00:00
refactor(handlers): reply returns unit
Every one of its call sites discarded the message id (a bare ?; or let _ =), so the Result carried a value nothing could use.
This commit is contained in:
@@ -32,16 +32,17 @@ use teloxide::utils::command::BotCommands;
|
|||||||
use urls::{URL_JOBS, extract_urls};
|
use urls::{URL_JOBS, extract_urls};
|
||||||
|
|
||||||
/// Reply to a message by id, keeping the reply decoration even if the
|
/// Reply to a message by id, keeping the reply decoration even if the
|
||||||
/// original was already deleted. Returns the reply's message id.
|
/// original was already deleted.
|
||||||
pub(crate) async fn reply(
|
pub(crate) async fn reply(
|
||||||
sender: &dyn MediaSender,
|
sender: &dyn MediaSender,
|
||||||
chat_id: i64,
|
chat_id: i64,
|
||||||
reply_to: MessageId,
|
reply_to: MessageId,
|
||||||
text: impl Into<String>,
|
text: impl Into<String>,
|
||||||
) -> Result<i64, RequestError> {
|
) -> Result<(), RequestError> {
|
||||||
sender
|
sender
|
||||||
.send_message(ChatId(chat_id), text.into(), Some(reply_to), None)
|
.send_message(ChatId(chat_id), text.into(), Some(reply_to), None)
|
||||||
.await
|
.await
|
||||||
|
.map(|_| ())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reply to a message by id with HTML parse mode (same reply decoration as
|
/// Reply to a message by id with HTML parse mode (same reply decoration as
|
||||||
|
|||||||
Reference in New Issue
Block a user