chore(lint): clean up frontend and Rust lint issues

This commit is contained in:
xintaofei
2026-04-23 15:56:41 +08:00
parent 1dd40d0baf
commit 022172a9ea
69 changed files with 1138 additions and 1248 deletions
@@ -34,10 +34,7 @@ impl TelegramBackend {
}
fn api_url(&self, method: &str) -> String {
format!(
"https://api.telegram.org/bot{}/{}",
self.bot_token, method
)
format!("https://api.telegram.org/bot{}/{}", self.bot_token, method)
}
async fn send_text(
@@ -171,9 +168,8 @@ impl ChatChannelBackend for TelegramBackend {
{
offset = uid + 1;
}
if let Some(text) = update
.pointer("/message/text")
.and_then(|t| t.as_str())
if let Some(text) =
update.pointer("/message/text").and_then(|t| t.as_str())
{
// Group chat filtering: only process if @bot is mentioned
let chat_type = update
@@ -184,8 +180,7 @@ impl ChatChannelBackend for TelegramBackend {
if (chat_type == "group" || chat_type == "supergroup")
&& !bot_username.is_empty()
{
let at_bot =
format!("@{}", bot_username);
let at_bot = format!("@{}", bot_username);
if !text.to_lowercase().contains(&at_bot) {
eprintln!("[Telegram] skipped group msg without @bot: {text}");
continue;