From f2900d834e77fe80125cfc32fe18ff6972827884 Mon Sep 17 00:00:00 2001 From: videogame hacker Date: Sun, 17 Apr 2022 12:08:11 +0100 Subject: [PATCH] Add attachments for messages from Discord on receipt --- services/phoebe-discord/src/handler.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/services/phoebe-discord/src/handler.rs b/services/phoebe-discord/src/handler.rs index 6a3e352..93bf365 100644 --- a/services/phoebe-discord/src/handler.rs +++ b/services/phoebe-discord/src/handler.rs @@ -69,11 +69,18 @@ impl EventHandler for DiscordHandler { .as_ref() .map(|m| ChatMessageReference::new(discord_reference(m.channel_id), m.id)); + let attachments = message + .attachments + .into_iter() + .map(|a| a.url) + .map(ChatAttachment::URL) + .collect::>(); + let chat_message = ChatMessage { origin, author, content, - attachments: vec![], + attachments, replying: replies_to, };