serenity-rs / poise

Discord bot command framework for serenity, with advanced features like edit tracking and flexible argument parsing
MIT License
624 stars 111 forks source link

CollectComponentInteraction is failing on the first interaction for every message. #193

Closed taimurey closed 9 months ago

taimurey commented 1 year ago

The CollectComponentInteraction isn't functioning correctly. The initial interaction consistently fails.

if let Some(mci) = CollectComponentInteraction::new(ctx.clone())
    .message_id(message_id)
    .filter(|_| true)
    .await
{

However, when utilizing a Message component, the interaction doesn't fail:

if let Interaction::MessageComponent(button) = &interaction {
scottbot95 commented 1 year ago

CollectComponentInteraction is a feature from serenity itself, not poise which is built on top of serenity. This issue would likely be better served in the serenity repo.


That said, what do you mean by it "consistently fails"? That you get something like this in Discord?

image

If so, Discord requires that interactions are "acknowledged". This can be done by creating a follow up, editing the original message, or sending a DEFERRED_UPDATE_MESSAGE response. CollectComponentInteraction will do none of these by default so it is on you to respond to the interaction somehow. I'm not sure how you're acquiring a reference to an Interaction in your second case, but is it possible that you're acknowledging the interaction somehow in that case?

kangalio commented 1 year ago

I think @taimurey may be hitting the issue that I fixed here: https://github.com/serenity-rs/serenity/pull/2388

That fix will be released with the next major version of serenity

GnomedDev commented 9 months ago

This has been fixed upstream.