#Response or Defer?

1 messages · Page 1 of 1 (latest)

cloud plaza
#

I'm trying to make an invisible response to a select menu interaction without the negative side effect of deferring.

A user will trigger a long chain of actions with the selection in a selectmenucomponent, after which a thread will be made for them. I can defer early on in the process to avoid the message that 'this interaction has failed' even though it hasn't, but that stops the selectmenu from going back to its placeholder state for that user.

I can also respond, but I don't really want to send a message, even ephemerally, because it's supposed to be a channel with only the selectmenu in it. So far my best option is making a message in the locked channel that a thread is being made and then delete it, but since it's a personal thread, everyone will see a change blip in the channel. A close second bad option would be an ephemeral response that I can't even delete.

Is there any proper alternative to letting the user's client know the interaction has been handled without Defer or Response? I thought " await Task.CompletedTask;" might do the trick, but that just gets me back to the interaction failed message

cloud plaza
#

Maybe I'm on the wrong track here, because I do manage to delete the ephemeral response with DeleteOriginalResponseAsync(). So what triggers the cleanup of the selectmenucomponent and how am I not getting there, even with a valid ResponseAsync("please wait",ephemeral:true)

cloud plaza
#

This is more or less what I think the documentation wants me to do, but this does not result in the selectmenu resetting. It just keeps the last chosen option. Weirdly enough, I want the behaviour that happens when it says 'interaction failed' without giving the user that wrong impression, because the code works

{
    await arg.DeferAsync();
    var selectValue = string.Join(", ", arg.Data.Values);
    
    if (selectValue == "thatOneException")
    {

        var textInput = new TextInputBuilder().WithLabel("Verify code:");
        textInput.MaxLength = 6;
        textInput.CustomId = "input-verify-code";
        ModalBuilder b = new ModalBuilder().WithTitle("Verify").WithCustomId("verify-modal").AddTextInput(textInput);
        await arg.RespondWithModalAsync(b.Build());

    }
    else
    {
        await arg.DeferAsync(true);
        await Task.Run(async () =>
        {

            //process of > 3 seconds that ends up making a private thread

            
        });
await arg.FollowupAsync("Thread made", ephemeral: true);
    }

       
 
}```
cloud plaza
#

Short version of the problem: in the above working code, I want to reset the state of the selectmenucomponent in the original message