Closed patrickjm closed 1 year ago
The linked PR implements support for attachments in initial command responses, but not in their edits. In fact, serenity doesn't have support for that itself: https://docs.rs/serenity/latest/serenity/builder/struct.EditInteractionResponse.html
I created a tracking issue for the missing serenity feature https://github.com/serenity-rs/serenity/issues/2412
Actually, serenity has already had support for editing initial interaction response attachments, I just didn't notice it was on the next
branch, which will be released with serenity 0.12.
Once serenity 0.12 releases, poise will update to it too. Alternatively you can use poise's serenity-next
branch
Hi @kangalio, thanks for looking into that. I updated my project to point to the serenity-next
branch, but this is still resulting in no images:
let mut response = CreateReply::new().content(format!(
"{} - **{}**",
"@User".to_string(),
self.prompt.clone()
));
for (i, file) in data.drain(..).enumerate() {
response = response.attachment(CreateAttachment::bytes(file, format!("{}.png", i)));
}
reply.edit(ctx, response).await?;
Does that mean I should call serenity directly through poise?
Oops I forgot to implement support in poise
What's a good way to edit an initial command response in poise to add an attachment?
Looks like support for that was added to poise in #66, but I am having issues. The image doesn't appear in Discord when I do this:
But doing something similar with Embeds does work.
Any advice appreciated, thank you.