Skip to content

Commit

Permalink
refactor: new message format style
Browse files Browse the repository at this point in the history
  • Loading branch information
itsusinn committed Feb 1, 2022
1 parent da4c7d3 commit 7bbb6aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/message/handlers/receive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub async fn handle_receive_message(mut message: Message, target: i64) -> anyhow
};
match single {
MessageType::Text { content } => {
let content = format!("{}: {}", sender_name, content);
let content = format!("{}:\n{}", sender_name, content);
let receipt = if let Some(reply_to) = &message.reply {
let local_id = DB.get_msg_id_1(&target, reply_to)?;
match local_id {
Expand All @@ -59,7 +59,7 @@ pub async fn handle_receive_message(mut message: Message, target: i64) -> anyhow
let channel = CONFIG.mapper(&target).expect("频道不存在");
let path = CACHE.file(&id, &url, &channel).await?;
let receipt = TG_BOT
.send_message(target, format!("{} :", sender_name))
.send_message(target, format!("{}:", sender_name))
.await?;
DB.put_msg_id_ir_2(&target, &receipt.id, &message.id)?;
let receipt = TG_BOT.send_photo(target, InputFile::File(path)).await?;
Expand Down

0 comments on commit 7bbb6aa

Please sign in to comment.