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

Inline Replies #2118

Merged
merged 10 commits into from
Nov 16, 2020
Merged

Inline Replies #2118

merged 10 commits into from
Nov 16, 2020

Conversation

msciotti
Copy link
Contributor

@msciotti msciotti commented Oct 2, 2020

These changes are not yet merged or deployed for everyone. It will be about 3 weeks before this feature is complete, so this is simply a heads up!


API support for inline replies! Be mindful of the different types between v6 and v8. We did this so as to not make breaking changes in v6.

While a new type is generally not a breaking change, in this case, not handling the new type would mean missing out on a lot of messages in chat for things like moderation bots, and we didn't want to break that.

v8 is still new and not default yet, so we felt comfortable using a new type there.


EDIT 10/28: some changes to required fields and new allowed_mentions behavior: #2118

@msciotti msciotti requested a review from meishuu October 2, 2020 00:24
@advaith1
Copy link
Contributor

advaith1 commented Oct 2, 2020

🤔 seems weird to document the reply behavior in the gateway events instead of just the message object instead, unless they don't show in rest?

also I added more message_reference details in #2053 so I'll update that to include reply details

@gBasil
Copy link

gBasil commented Oct 2, 2020

Is it possible for normal users to make inline replies? or just bots?

@msciotti
Copy link
Contributor Author

msciotti commented Oct 2, 2020

@GunnerBasil yes of course! Replies are a feature intentionally for users. We're documenting them for bots ahead of time due to the type changes that need to be handled.

@ioistired
Copy link

ioistired commented Oct 2, 2020

What does a reply look like on v6? Are the fields just missing or does it use the old Replying to x from y / Replying to y format?

docs/topics/Gateway.md Outdated Show resolved Hide resolved
@SinisterRectus
Copy link
Contributor

Is it necessary to say that referenced_message is not guaranteed on MESSAGE_UPDATE and MESSAGE_DELETE? They both already make no guarantees except for id and channel_id.

@ThatTonybo
Copy link

Is there any sort of demo on how these'll look and function in the apps and clients?

docs/Change_Log.md Outdated Show resolved Hide resolved
@Andre601
Copy link
Contributor

Andre601 commented Oct 2, 2020

What does a reply look like on v6? Are the fields just missing or does it use the old Replying to x from y / Replying to y format?

The v6 equivalent of inline-reply is afaik the quote. From what I gathered is the inline-reply just a new and fancy version of the "Quote message" feature Discord offers.
So the v6 equivalent would be

> User Message
@UserMention Response Message

Also, if you had read the very first comment would you know that this hasn't deployed yet and will take at least 3 additional weeks until it is ready.

docs/resources/Channel.md Outdated Show resolved Hide resolved
@ghost ghost mentioned this pull request Oct 2, 2020
docs/resources/Channel.md Outdated Show resolved Hide resolved
@leo60228
Copy link

leo60228 commented Oct 2, 2020

@ThatTonybo There's partially implemented client-side support in today's PTB (not rolled out yet so you have to be a Discord employee or client modder to enable):
image

docs/resources/Channel.md Outdated Show resolved Hide resolved
@ghost
Copy link

ghost commented Oct 3, 2020

Is it necessary to say that referenced_message is not guaranteed on MESSAGE_UPDATE and MESSAGE_DELETE? They both already make no guarantees except for id and channel_id.

Clearly defining what is provided on those events would be nice, purely because it is pointless if you don't have any behavioural guarantee of when they will or will not appear, especially if that differs to what you would expect. It probably matters more to library devs than to people just using the API for a specific application, but the ambiguity here is not a nice thing to have to deal with unnecessarily.

For consistency, I agree, but ideally this shouldn't be left unclearly defined for this at all for any of these fields; it leaves confusion about what cases you actually expect this information.

@advaith1

This comment has been minimized.

@Nicofisi
Copy link

Nicofisi commented Nov 16, 2020

Will webhooks support replies? I maintain matterbridge, which is a bot that bridges chats between Discord and other chat platforms. We use webhooks so that we can change the message username and avatar to look like the person that sent the message.

Making it possible to send a webhook in reply to a message will allow us to bridge Slack threads nicely. (Otherwise we'll have to drop down to regular bot user messages when doing replies.)

I would love it for that exact reason, too! I was in need to write such integration myself a few times (in-game chat <-> Discord, for a few games), and the ability for me to add replies to Discord messages from in-game would be a great feature!

we want to keep the future open for some form of message embedding / forwarding.

@meishuu Personally I'm VERY looking forward to the ability to reply to/quote/whatever you call it, messages in a different channel. An example use case would be programming/art making/music/etc. related servers where people share their work in one channel (#projects), asking for opinions, and the server rules allow others to comment on them only in a separate channel meant for feedback. (#projects-feedback). Same thing with #contests listing some server contests and #contest-submissions. Same thing with #server-organization-questions with open questions from staff, and #server-organization-feedback with answers from the members. Poor naming here, but you get the idea :)

It would also be great to be able to privately reply to someone's question in their DMs! When the answer involves something private, or you've read the message after a really long time, and find it relevant only for you and the person you're replying to.

Cheers!

@@ -258,7 +260,7 @@ Represents a message sent in a channel within Discord.
| Field | Type | Description |
|-------------|-----------|-----------------------------------------|
| message_id? | snowflake | id of the originating message |
| channel_id? | snowflake | id of the originating message's channel |
| channel_id | snowflake | id of the originating message's channel |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this supposed to be marked as required again here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I mistakenly made it optional in one of the passes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JK I was wrong. It's optional when sending a reply, but will always be included when you receive this structure in an event/endpoiint.

@msciotti
Copy link
Contributor Author

Merging this PR since replies are now out! Thank you all for the feedback and help getting it ready, and enjoy the feature :)

@msciotti msciotti merged commit 7a0f76f into master Nov 16, 2020
@msciotti msciotti deleted the feature/inline-replies branch November 16, 2020 21:54
@brianseminara
Copy link

this is cool!

@suburbGira

This comment has been minimized.

@ghost ghost mentioned this pull request Nov 17, 2020
4 tasks
Erk- added a commit to Erk-/twilight that referenced this pull request Nov 17, 2020
This changeset adds support for replies as described in the
following pr:
discord/discord-api-docs#2118
and the subsequent commit
discord/discord-api-docs@e2cbad6

Signed-off-by: Valdemar Erk <valdemar@erk.io>
@ghost
Copy link

ghost commented Nov 17, 2020

@jhgg: is there any possibility of webhook replies being added in the future? not having this feature impacts usability with bots that replace users' messages with webhooks (such as pluralkit or tupperbox). if there's a permission needed for it, it could be given to @everyone - whether it be read message history or whatever else is required

@ddk7b
Copy link

ddk7b commented Nov 17, 2020

Seeing this on my bot would be great :). Keep up the good work

andersfylling added a commit to andersfylling/disgord that referenced this pull request Nov 19, 2020
andersfylling added a commit to andersfylling/disgord that referenced this pull request Nov 19, 2020
* unexport all Handler interfaces

* remove logic deprecated in v0.21

* patch up integration tests

* bump version to v0.22

* unexport Reset() method

* cleanup events docs & patch intents helpers

* replace Guild(..).VoiceConnect(..) with Guild(..).VoiceChannel(..).Connect(..)

* restrict VoiceChannelQueryBuilder methods + update voice example

* inline reply (discord/discord-api-docs#2118)

* add message sticker

* cleanup merge mistakes

* remove handler signatures from events files, rename them in reactor *Handler => Handler*

* fix accidental autor refactor issues

* remove Emiter interface

* cleanup event documentation
Erk- added a commit to Erk-/twilight that referenced this pull request Nov 21, 2020
This changeset adds support for replies as described in the
following pr:
discord/discord-api-docs#2118
and the subsequent commit
discord/discord-api-docs@e2cbad6

Signed-off-by: Valdemar Erk <valdemar@erk.io>
Erk- added a commit to Erk-/twilight that referenced this pull request Nov 25, 2020
This changeset adds support for replies as described in the
following pr:
discord/discord-api-docs#2118
and the subsequent commit
discord/discord-api-docs@e2cbad6

Signed-off-by: Valdemar Erk <valdemar@erk.io>
l7ssha added a commit to nyxx-discord/nyxx that referenced this pull request Feb 11, 2021
l7ssha added a commit to nyxx-discord/nyxx that referenced this pull request Mar 29, 2021
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.