Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attachment names string treatment is not consistent between different functions #2635

Open
asibahi opened this issue Nov 29, 2023 · 0 comments
Labels
bug Something misbehaves or is not working.

Comments

@asibahi
Copy link

asibahi commented Nov 29, 2023

Serenity version: I am using poise 0.6.0

Rust version (rustc -V): 1.74

Minimal test case if possible:

    // inside a command function
    let attachment_name = format!("{}'s_{}.png", "some", "one"); // mind the apostrophe

    let attachment = serenity::CreateAttachment::bytes(image_data, &attachment_name); // 👈 first use here

    let embed = serenity::CreateEmbed::new()
         // other things here
        .attachment(attachment_name); // 👈 second use here

    let reply = poise::CreateReply::default()
        .attachment(attachment)
        .embed(embed);
}

the apostrophe in attachment_name causes the two functions to give different output somehow. The attachment is no longer in the embed.

attachment out of the embed

Removing the apostrophe resolved that problem.

attachment inside the embed
@kangalio kangalio added the bug Something misbehaves or is not working. label Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something misbehaves or is not working.
Projects
None yet
Development

No branches or pull requests

2 participants