-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow getting ephemeral followups #533
Allow getting ephemeral followups #533
Conversation
Let's see what happens to this: discord/discord-api-docs#4496 |
Ok, seems like getting ephemeral followup messages is not official (yet?) and subject to change. I would still keep the type change from |
waiting for #531 |
# Conflicts: # core/src/main/kotlin/behavior/interaction/response/InteractionResponseBehavior.kt # core/src/main/kotlin/entity/Message.kt # core/src/main/kotlin/entity/interaction/FollowupMessage.kt # core/src/main/kotlin/event/interaction/ApplicationCreate.kt # core/src/main/kotlin/supplier/CacheEntitySupplier.kt # core/src/main/kotlin/supplier/EntitySupplier.kt # core/src/main/kotlin/supplier/FallbackEntitySupplier.kt # core/src/main/kotlin/supplier/RestEntitySupplier.kt # core/src/main/kotlin/supplier/StoreEntitySupplier.kt
This is now ready, I merged the interaction refactor into this. |
does getting them means we can delete? |
Nope, that did not work the last time I checked. So we still need the type distinction between public/ephemeral. The user can just check with |
@@ -440,11 +440,11 @@ public class RestEntitySupplier(public val kord: Kord) : EntitySupplier { | |||
applicationId: Snowflake, | |||
interactionToken: String, | |||
messageId: Snowflake, | |||
): PublicFollowupMessage? = catchNotFound { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it that the types here changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the endpoint returns a message with the ephemeral flag it shouldn't be a PublicFollowupMessage
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we are going to use flags to determine ephemeral and public?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's exactly what the FollowupMessage()
function does. The edit
extension function for FollowupMessageBehavior
already did this before (see here).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or is there a downside to this that I'm missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then what's the point of the distinction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you know Discord have the ephmeral flag; we don't usually compare by types and flags for entites
e.g DmChannel and TextChannel; they have their own types
Ephemeral and Public are parts of the concepts of interactions; also it's nice to express the distinction as an is
rather than ==; it reads better and being a firm type makes it good.
On the other hand; your PR seems to have changed some of the parts that are going to change in V10 (which are not that hard to migrate to discord/discord-api-docs#4510
not sure abotu the attachment patch thing yet tho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok makes sense to have separate types for this.
So the thing you suggest now is to migrate all methods on followup messages to FollowupMessageBehavior
(and including a warning that it might not work for ephemerals)?
On the other hand; your PR seems to have changed some of the parts that are going to change in V10 (which are not that hard to migrate to discord/discord-api-docs#4510
Not sure which changes exactly you are referring to here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[ALL VERSIONS] application.summary now returns an empty string. This field will be removed in v11
although we need a separate PR for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this could be in scope for #530
Discord removed the ability to edit ephemeral followups two days ago (see discord/discord-api-docs#4414). Should we remove this function for ephemeral followups then? |
Seems like they reverted that, it's working again. |
Any official word on it? |
I've taken this from @DRSchlaubi (https://discord.com/channels/556525343595298817/631147109311053844/949635018844692530), nothing official. |
I also found this message: https://discord.com/channels/613425648685547541/788586647142793246/947415392530337812 |
Since there is no change on this yet ig we can reintroduce them; this is kinda annoying |
I didn't even remove the ability to edit ephemeral followups in the first place since it wasn't clear what would happen next, so we are all set in this regard. |
Changes
getFollowupMessage[OrNull]()
inInteractionResponseBehavior
andEntitySupplier
s fromPublicFollowupMessage
toFollowupMessage
:You can not only get public followups but also ephemeral ones, this isn't documented yet though (it was for a short time but got reverted). Instead of hard coding the visibility of the followup message for these methods decide on the actual type by the flags of the message. This is safe for any changes Discord decides to make.
ApplicationCommand
toChatInputCommand
(changed in discord/discord-api-docs@3973676)FollowupMessageCreateBuilder.ephemeral
fromvar
toval
to prevent something like this:Additions
flags
property toMessage
MessageFlag.FailedToMentionSomeRolesInThread
(introduced in discord/discord-api-docs@2d13f67)MessageType.ContextMenuCommand
(introduced in discord/discord-api-docs@3973676)