Add attachments for messages from Discord on receipt

main
Charlotte Som 2022-04-17 12:08:11 +01:00
parent 77fd8b1ecb
commit f2900d834e
1 changed files with 8 additions and 1 deletions

View File

@ -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::<Vec<_>>();
let chat_message = ChatMessage {
origin,
author,
content,
attachments: vec![],
attachments,
replying: replies_to,
};