Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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 webhooks to use reply messages #2251

Closed
davfsa opened this issue Nov 18, 2020 · 8 comments
Closed

Allow webhooks to use reply messages #2251

davfsa opened this issue Nov 18, 2020 · 8 comments

Comments

@davfsa
Copy link
Contributor

davfsa commented Nov 18, 2020

A webhook is attached to a specific channel. Surely the channel association alone would be enough to say "this webhook can reply to messages in this channel"? If that's not enough, what about the (bot) user that created the webhook?

In our particular use case, we use a bot user for reading messages, but a webhook for sending messages. So we would always be able to get message IDs of non-webhook-sent messages. It's just that the webhook specifically allows for added flexibility in setting the username/avatar.

Note that WebhookExecute returns the message ID that was created (if you provide ?wait=1), so a webhook on its own (without a bot user) is always able to get some message ID to reply to.

And similarly webhooks have these other endpoints that allow a webhook to modify messages that it sent:

  • PATCH /webhooks/{webhook.id}/{webhook.token}/messages/{message.id}
  • DELETE /webhooks/{webhook.id}/{webhook.token}/messages{message.id}

So, at the very least, the functionality to reply to a webhook's own messages seems reasonable to me. Although, it would be ideal if a webhook could reply to any messages in its channel. I would be extremely thankful if you could consider this.

Originally posted by @qaisjp in #2118 (comment)

@davfsa davfsa changed the title [Feature Request] Allow webhooks to Allow webhooks to use reply messages Nov 18, 2020
@muddyfish
Copy link
Contributor

Not being able to receive the message reference through ?wait=1 or through editing would be completely fine for my use case, and could potentially clear some security issues on your side.
An alternate could be providing some proof that you know the message content regardless so no information is leaked.

For what it's worth, I've already had 5 users of my bot ask why this isn't already a thing

@EvyBongers
Copy link

Any news if/when this might be implemented?

@sairam4123
Copy link

Would it be possible for a webhook to reply to it's own messages?

@qaisjp
Copy link
Contributor

qaisjp commented Apr 14, 2021

#2410 (comment) is pretty awesome!

The slash command interactions support fetching a previously created message:

/webhooks/<webhook_id>/<webhook_token>/messages/@original
/webhooks/<webhook_id>/<webhook_token>/messages/<message_id>

And slash command message posting is based on webhook infrastructure.

I'm hoping that the implementation of these endpoints has paved the road for potential future support of Webhook Replies.

@sairam4123
Copy link

sairam4123 commented Apr 15, 2021

That's good to hear! I am still here waiting for the replies system! And I got a little question, can you change the discriminator number of the webhooks, I'd be happy to see it, because I am making a global chat system, and if the user had same same and avatar, it'd become confusing, so I hope it's possible to create something like that sometime in the future.

Edit: Let me know if it's possible to get all the messages a webhook sent? Thank you.

@qaisjp
Copy link
Contributor

qaisjp commented Apr 15, 2021

if the user had same same and avatar, it'd become confusing

FYI, you can use something like an avatar generator, and salt the username with the source platform.

In practice I've never seen two different people with the same name and avatar, so I wouldn't bother accounting for situations where they have the same avatar.

E.g.

@cherryblossom000
Copy link
Contributor

This would be really useful for bots that bridge other communication services to Discord. For example, the Matrix appservice for Discord uses webhooks to simulate users sending messages from Matrix. It would be great if a Matrix user could use the reply feature in Matrix and it would be properly represented in Discord (see matrix-org/matrix-appservice-discord#693).

@JDJGInc
Copy link

JDJGInc commented May 26, 2021

People have made bridges already, and also for revolt.chat but yeah.

@discord discord locked and limited conversation to collaborators Jul 1, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

9 participants