#MessageComponent's do not update

1 messages · Page 1 of 1 (latest)

serene warren
#

I'm trying to fix a feature of my bot which recently broke which requires a message component of a slash command to update after a button press.

await (Context.Interaction as SocketMessageComponent)?.UpdateAsync(x =>
{
    x.Embed = null;
    x.Content = $"Page {page + 1}";
    x.Components = CreateTopicManager("", page);
});
#

I know that the component is created correctly but the whole message just does not update anymore.

#

I think I had this issue before but forgot the workaround

#

note: ModifyOriginalResponseAsync just fails the response entirely

cloud hamlet
#

thats because theres no response to modify

#

respond to- or defer the message, then use modify

#

if you want to update a message that was used as response to the previous interaction, use updateasync

serene warren
#

the slash command triggers a message with a component, the component contains a button that should change it to a new component, but even the text doesn't update

cloud hamlet
#

nothing updates?

serene warren
#

Nothing updates

cloud hamlet
#

are you sure it reaches updateasync

serene warren
#

Yes

cloud hamlet
#

and doesnt null out

serene warren
#

Yes

cloud hamlet
#

thats really odd

serene warren
#

If I remove the component and set it to null, then the text will update

cloud hamlet
#

then updateasync is failing at formatting the message

#

are you sure your buttons are not malformed

#

does it throw invalid form body or alike errors

serene warren
#

No errors

#

None from discord or the console output

cloud hamlet
#

subscribed to the log event?

#

(of the interaction service)

serene warren
#

I'll have to double check this. But for what it's worth, the original message component is made with the same function

#

The button just updates what's in the combo

cloud hamlet
#

maybe the page buttons are erroring out because of length or whatever

#

its hard to figure out without the code behind it

#

but the log event should give more feedback

serene warren
#

Do you normally need that to see errors?

cloud hamlet
#

yes

#

inside commands you do

#

it will print through that log stream

serene warren
#

I've seen 'invalid form body' when I was originally making this command basically

#

So I'm thinking I might already have that on

cloud hamlet
#

its an error discord returns upon REST request, not the interaction framework

serene warren
#

Ah I see

cloud hamlet
#

it could just be failing in method and you wouldnt see it, because the command module is on async thread

serene warren
#

Even still discord doesn't show the interaction as failing

#

Like inside the client it behaves as if it succeeded

cloud hamlet
#

updateasync does not have failure behavior iirc, I experimented with it in the past

#

I use it a lot, thats why I'm so confused

#

cant really reproduce your issue, I do the same thing

serene warren
#

Here's what's stranger, I do this with other commands and it works

#
  • it used to work
#

I'll look into the logging

#

Would be funny if the API has been telling me the entire time it's something like a combo value being bad

cloud hamlet
#

its hard to show what I did since I work with a different lib now. Give me a moment to go back 40 commits kek

serene warren
#

Which lib out of curiosity?

cloud hamlet
#

disqord

#

its not really 'finished', but its feature rich enough if you're willing to write your own extensions for more direct needs

#

its non entity bound, you can send a message to a channel without ever needing the channel entity

#

its just client.SendMessageAsync(channelId, messageId, message);

#

very elegant

serene warren
#

Agreed

cloud hamlet
#

this is old code I used

#

this is for rest interactions so the actual response mechanic is different

#

but view 'update' as updateasync

serene warren
#

@cloud hamlet hey, sorry it took a while. I added a Log event handler, there's no errors or any related output

#

does disqord support slash commands and component interactions?