-
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
Forms support #531
Forms support #531
Conversation
HopeBaron
commented
Feb 10, 2022
- Adds Form support
- changes the tree of Interactions to match the following diagram:
You can already receive modals via the gateway and send modals via REST
…s and text inputs sharing the same field name
Co-authored-by: Lukellmann <[email protected]>
Edit: it was added in 4b96ef5 |
Co-authored-by: Lukellmann <[email protected]>
* return types * sealed InteractionResponseBehavior * ClosedRange<Int> instead of IntRange * rename file
* move MessageInteraction into Message * interactions * clarify why ComponentInteractionBehavior is no ModalParentInteractionBehavior * typo * rename ApplicationCommandInteractionInteractionCreateEvent to ApplicationCommandInteractionCreateEvent * move ResolvedObjects * attachments in InteractionCommand * fix InteractionCommand.filterOptions() * Entity in mentionables again * move duplicate code to InteractionCommand * ActionRowComponent docs * rename acknowledge * maps for components
@@ -695,6 +699,7 @@ public sealed class InteractionResponseType(public val type: Int) { | |||
public object DeferredUpdateMessage : InteractionResponseType(6) | |||
public object UpdateMessage : InteractionResponseType(7) | |||
public object ApplicationCommandAutoCompleteResult : InteractionResponseType(8) | |||
public object Modal : InteractionResponseType(9) |
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.
missing 9 -> Modal
in deserialize
of InteractionResponseType.Serializer
(but usually it should only be serialized)
|
||
override suspend fun getChannel(): GuildMessageChannel = supplier.getChannelOf(channelId) | ||
|
||
override suspend fun getChannelOrNull(): MessageChannel? = supplier.getChannelOfOrNull(channelId) |
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.
override suspend fun getChannelOrNull(): MessageChannel? = supplier.getChannelOfOrNull(channelId) | |
override suspend fun getChannelOrNull(): GuildMessageChannel? = supplier.getChannelOfOrNull(channelId) |
* The behavior of an ephemeral [Discord ActionInteraction Response](https://discord.com/developers/docs/interactions/slash-commands#interaction-response) | ||
* This response is visible to *only* to the user who made the interaction. | ||
*/ | ||
public sealed interface EphemeralInteractionResponseBehavior : InteractionResponseBehavior |
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.
this link leads nowhere
/** | ||
* The behavior of a public [Discord ActionInteraction Response](https://discord.com/developers/docs/interactions/slash-commands#interaction-response) | ||
* This response is visible to all users in the channel. | ||
*/ | ||
|
||
public sealed interface PublicInteractionResponseBehavior : InteractionResponseBehavior |
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.
this link leads nowhere
public fun CommandArgument<*>.int(): Long { | ||
return value as? Long ?: error("$value wasn't an int.") | ||
} | ||
|
||
|
||
public fun CommandArgument<*>.string(): String { | ||
return value.toString() | ||
} |
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.
these two are used in tests