Skip to content
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

Add support for attachment options in chat input interactions #524

Merged
merged 3 commits into from
Feb 11, 2022

Conversation

MrPowerGamerBR
Copy link
Contributor

@MrPowerGamerBR MrPowerGamerBR commented Feb 6, 2022

Just as the title says. Currently attachments in chat input interactions support is locked and is only available to some users.

image
image
DiscordCanary_K1TrakyPCR

This PR is a draft because the feature isn't released yet, but it already works, so it can be merged when the feature is officially released :) The feature is officially released!

@MrPowerGamerBR MrPowerGamerBR marked this pull request as draft February 6, 2022 16:26
@MrPowerGamerBR
Copy link
Contributor Author

InteractionCreate event when a attachment is sent:

InteractionCreate(interaction=DiscordInteraction(id=939946131327176734, applicationId=936390863704178758, type=InteractionType.ApplicationCommand(2), data=InteractionCallbackData(id=OptionalSnowflake.Value(snowflake=939920456784416808), type=Optional.Something(content=dev.kord.common.entity.ApplicationCommandType$ChatInput@301fd2df), targetId=OptionalSnowflake.Missing, name=Optional.Something(content=attachmenttest), resolved=Optional.Something(content=ResolvedObjects(members=Optional.Missing, users=Optional.Missing, roles=Optional.Missing, channels=Optional.Missing, messages=Optional.Missing, attachments=Optional.Something(content={939946130303762452=DiscordAttachment(id=939946130303762452, filename=859686182404882452.png, description=Optional.Missing, contentType=Optional.Something(content=image/png), size=40433, url=https://cdn.discordapp.com/ephemeral-attachments/939920456784416808/939946130303762452/859686182404882452.png, proxyUrl=https://media.discordapp.net/ephemeral-attachments/939920456784416808/939946130303762452/859686182404882452.png, height=Optional.Value(value=248), width=Optional.Value(value=252), ephemeral=Optional.Value(value=true))}))), options=Optional.Something(content=[UserArgument(name=attachment, value=939946130303762452, focused=OptionalBoolean.Missing)]), customId=Optional.Missing, componentType=Optional.Missing, values=Optional.Missing), guildId=OptionalSnowflake.Value(snowflake=936391274951503873), channelId=936391275391897652, member=Optional.Something(content=DiscordInteractionGuildMember(user=Optional.Something(content=DiscordUser(id=123170274651668480, username=MrPowerGamerBR, discriminator=4185, avatar=8bd2b747f135c65fd2da873c34ba485c, bot=OptionalBoolean.Missing, system=OptionalBoolean.Missing, mfaEnabled=OptionalBoolean.Missing, locale=Optional.Missing, verified=OptionalBoolean.Missing, email=Optional.Missing, flags=Optional.Missing, premiumType=Optional.Missing, publicFlags=Optional.Something(content=UserFlags(code=131712)), banner=null, accentColor=null)), nick=Optional.Null, roles=[], joinedAt=2022-01-27T22:44:37.270000+00:00, premiumSince=Optional.Null, permissions=Permissions(values=DiscordBitSet(11111111111111111111111111111111111111111)), pending=Optional.Value(value=false), avatar=Optional.Null, communicationDisabledUntil=Optional.Null)), user=Optional.Missing, token=no_u, version=1, message=Optional.Missing, locale=Optional.Something(content=Locale(language=en, country=GB)), guildLocale=Optional.Something(content=Locale(language=en, country=US))), sequence=3)

@MrPowerGamerBR MrPowerGamerBR marked this pull request as ready for review February 9, 2022 00:28
@HopeBaron HopeBaron merged commit cc0f1df into kordlib:0.8.x Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants