โœจ๐Ÿฅธ Sparkle Impostor

A third party crate for Twilight to execute Discord webhooks that clone an existing message

โœจ Features

This has grown to be a more complicated (and painful) project than expected, so let me list what it does

Opt-in features for edge-cases:

General features:

๐Ÿ˜‹ A Taste of Sparkle Impostor

This also serves as the example, since it includes most of the API surface

```rust let mut source = MessageSource::from_message(&message, &http) .expect("message really can't be cloned (voice message etc)");

// example error handling if let Err() = source.checkcomponent() { panic!("invalid components scare me"); }

let latermessages = source.latermessages_batched().await?;

// a lot of edge cases source .webhookname("custom modified exclusive webhook name".toowned()) .handleattachmentlink()? .handlestickerlink()? .handlereaction() .await? .handlereference()? .handlethread() .await? .sanitizeusername("?", "????") .create() .await? .handlethreadcreated() .await?;

for latermessage in latermessages { // create every message sent later later_message?.create().await?; } ```

๐Ÿ“ฆ Cargo Features

๐Ÿ™ Feedback

Although widely tested, there may still be bugs, or you might have feature suggestions, please create issues for these!

๐Ÿงช Testing

The crate uses integration tests as opposed to unit tests to test real-world usage. It creates a message and clones it, then the tester checks if the message is cloned as expected

Before starting, set these environment variables, you can also put them in a .env file:

Required permissions in CHANNEL_ID and FORUM_CHANNEL_ID:

Required additional permissions in FORUM_CHANNEL_ID:

Test with a single thread to avoid race conditions: cargo test --all-features -- --test-threads=1