fix(channels): resolve telegram reply target and media delivery (#525)

Co-authored-by: Will Sarg <12886992+willsarg@users.noreply.github.com>
This commit is contained in:
Chummy 2026-02-17 21:07:23 +08:00 committed by GitHub
parent efa6e5aa4a
commit ae37e59423
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 561 additions and 164 deletions

View file

@ -363,7 +363,11 @@ impl Channel for DiscordChannel {
};
let message_id = d.get("id").and_then(|i| i.as_str()).unwrap_or("");
let channel_id = d.get("channel_id").and_then(|c| c.as_str()).unwrap_or("").to_string();
let channel_id = d
.get("channel_id")
.and_then(|c| c.as_str())
.unwrap_or("")
.to_string();
let channel_msg = ChannelMessage {
id: if message_id.is_empty() {
@ -372,8 +376,12 @@ impl Channel for DiscordChannel {
format!("discord_{message_id}")
},
sender: author_id.to_string(),
reply_to: channel_id.clone(),
content: clean_content,
reply_target: if channel_id.is_empty() {
author_id.to_string()
} else {
channel_id
},
content: content.to_string(),
channel: "discord".to_string(),
timestamp: std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)