pub async fn clear_components(
    ctx: &Context,
    interaction: &MessageComponentInteraction,
    msg: &mut Message,
) -> Result<()> {
    interaction
        .create_interaction_response(ctx, |r| {
            r.kind(InteractionResponseType::DeferredUpdateMessage)
        })
        .await?;

    msg.edit(ctx, |m| m.components(|c| c)).await?;

    Ok(())
}
// Using Deferred since updating the message and Interaction Response
// doesnt update the original message
Using Deferred since updating the message and Interaction Response
doesnt update the original message
Using Deferred since updating the message and Interaction Response doesnt update the original message
pub async fn clear_components(
    ctx: &Context,
    interaction: &MessageComponentInteraction,
    msg: &mut Message,
) -> Result<()> {
    interaction
        .create_interaction_response(ctx, |r| {
            r.kind(InteractionResponseType::DeferredUpdateMessage)
        })
        .await?;
    msg.edit(ctx, |m| m.components(|c| c)).await?;
    Ok(())
}
pub async fn clear_components ( ctx : & Context , interaction : & MessageComponentInteraction , msg : & mut Message , ) -> Result < ( ) > { interaction . create_interaction_response ( ctx , | r | { r . kind ( InteractionResponseType :: DeferredUpdateMessage ) } ) . await ? ; msg . edit ( ctx , | m | m . components ( | c | c ) ) . await ? ; Ok ( ( ) ) }
Using Deferred since updating the message and Interaction Response
doesnt update the original message
Using Deferred since updating the message and Interaction Response doesnt update the original message
ctx
&Context
interaction
&MessageComponentInteraction
msg
&mut Message