Skip to content

Conversation

@jamesbt365
Copy link
Member

@jamesbt365 jamesbt365 commented Feb 21, 2025

Opened early, but getting a PR open sooner rather than later doesn't hurt.

TODO:

  • Base typing
  • Test thoroughly to make sure everything deserializes
  • Assure that I'm typing this correctly and not making things vague where it shouldn't be
  • Make Component & others more resilient to discord changes
    • Right now any change discord makes to components could knock out our Message deserialization.
  • Mark under unstable feature flag
    • This is still getting breaking changes and we should wait until rollout before marking this as stable.
  • Use FixedString everywhere relevant.
  • Add relevant builders
  • Document, including updating limits.

Additionally, we really need to PR to current and modify the deserialization to not fail if the top level component is not an ActionRow or it will not deserialize. (See #2963) (Done in #3127)

Once merged, as usual a PR to poise@serenity-next to add support over there too!

@jamesbt365 jamesbt365 added enhancement An improvement to Serenity. discord feature Related to Discord's functionality. labels Feb 21, 2025
@github-actions github-actions bot added model Related to the `model` module. examples Related to Serenity's examples. builder Related to the `builder` module. collector Related to the `collector` module. labels Feb 21, 2025
@jamesbt365 jamesbt365 force-pushed the components-v2 branch 2 times, most recently from 59f40fd to 778ab88 Compare February 27, 2025 01:22
@github-actions github-actions bot removed the examples Related to Serenity's examples. label Feb 27, 2025
@jamesbt365 jamesbt365 marked this pull request as ready for review February 28, 2025 16:08
@jamesbt365
Copy link
Member Author

Clippy failure does not seem like my fault? But this should be complete now.

@jamesbt365
Copy link
Member Author

I forgot the new field for webhooks, will add later.

@jamesbt365
Copy link
Member Author

I forgot the new field for webhooks, will add later.

Seems like this applies prior to ComponentsV2 too, though the restriction here is that they can only use non-interactive components on non application owned webhooks when sending this query param.

This can be implemented separately as this works on link buttons from my understanding and the information on https:discord/discord-api-docs#7368.

So... this PR should be done completely and now just needs a review (and fixing whatever funky stuff is going on with our CI?)

@jamesbt365
Copy link
Member Author

rebased for review reasons, but due to a timecrunch i haven't added V2 support on webhooks yet, will do in a couple hours when i get back.

@jamesbt365
Copy link
Member Author

rebased for review reasons, but due to a timecrunch i haven't added V2 support on webhooks yet, will do in a couple hours when i get back.

Disregard this comment, i didn't have time to properly check but what was needed was added cleanly in the rebase.

@jamesbt365
Copy link
Member Author

Rebased, history will be a little weird because i removed the macro and stuff entirely from the history, doesn't really matter though, makes even sense while going through.

Will refer to unofficial docs and get this in as best of a state I can before monday, when the draft PR for docs will drop.

@jamesbt365
Copy link
Member Author

A little note to myself (i'm about to test if i messed this up) i'm not sure if putting an enum over the media items is required/better, nullablity is not confirmed completely yet and we won't know until the docs on monday, i'll go over everything one last time then and hopefully nail it.

@github-actions github-actions bot added the examples Related to Serenity's examples. label Apr 18, 2025
@jamesbt365
Copy link
Member Author

I have gone ahead and updated it to match official documentation in discord/discord-api-docs#7487, I am technically doing undocumented stuff right now as for whatever reason they didn't add the extra fields for the unfurled media item, not sure if thats intentional or not yet.

@jamesbt365
Copy link
Member Author

This feature has now been officially released! I (hopefully) have nailed it now and it should be ready for any reviews before merge!

I did remove the loading state in the most recent commit, we don't reflect that for embeds (which i think have one too, under the hood) as the docs do not show this.

I will leave it under the unstable feature gate until a little bit after merge (even though its on the next branch) as a precaution as I don't know how stable the de-serialization and stuff is. I've been running it on my bot for a few days and it has been stable though!

@GnomedDev
Copy link
Member

Can we remove the unstable gate? It is expected for next to be unstable, the gate is just for undocumented features.

@github-actions github-actions bot added framework Related to the `framework` and `framework::standard` modules and/or the `command_attr` crate voice Related to the `voice` module and `serenity_voice_model` crate. labels Apr 30, 2025
jamesbt365 added 18 commits May 19, 2025 23:16
So... yeah, not under `unstable` yet but things are just starting to work!

Need to refactor some old component stuff, and when i put this under the
unstable feature I've got some code duplication to handle.

Going well so far, sections work great and are really extensive
I do need to look at resolved media stuff, as right now i don't handle
that.
This is just a duplicate of MessageFlags and having this duplicate impl
for the same flags just adds extra complexity for poise, we don't
usually wrap like this in other places like serenity, so I replaced it
with MessageFlags
Also changes the modal stuff back to CreateActionRow, no need for this
extra layer of nesting if modals only use ActionRow?
@jamesbt365
Copy link
Member Author

Merging due to approving review, also tested it myself for about a month and other users have also been using it for a while and have not reported any issues. I'll get a PR ready for poise soon:tm: (or somebody else can do that)

@jamesbt365 jamesbt365 merged commit 4f51050 into serenity-rs:next Jun 29, 2025
24 checks passed
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Jun 30, 2025
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Jun 30, 2025
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Jun 30, 2025
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Jul 28, 2025
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Jul 28, 2025
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Oct 7, 2025
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Oct 7, 2025
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builder Related to the `builder` module. discord feature Related to Discord's functionality. enhancement An improvement to Serenity. examples Related to Serenity's examples. model Related to the `model` module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants