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 a field for bots to reacji in response to webhooks #12811

Open
jdherg opened this issue Jul 18, 2019 · 7 comments · May be fixed by #18117
Open

Add a field for bots to reacji in response to webhooks #12811

jdherg opened this issue Jul 18, 2019 · 7 comments · May be fixed by #18117

Comments

@jdherg
Copy link
Contributor

jdherg commented Jul 18, 2019

Proposed syntax: reacji (or reaction_emoji) as a response key with the emoji name as the value. This would add that emoji as the bot's reaction to the message that caused the webhook.

{
  "reacji": "octopus"
}

This would be mutually exclusive with response_not_required but could be used either with or without content.

This pattern would allow bots to provide feedback (✔️ for complete, etc) to users with a minimal amount of noise in the topic.

@timabbott
Copy link
Sponsor Member

@jdherg this is for outgoing webhook bots, in particular? The concept is reasonable.

API-wise, I don't think we want to create new abbreviations like reactji; we should have the formatting match the API for specifying one wants to add a reaction that exists elsewhere.

@zulipbot
Copy link
Member

Hello @zulip/server-bots members, this issue was labeled with the "area: bots" label, so you may want to check it out!

@jdherg
Copy link
Contributor Author

jdherg commented Aug 6, 2019

Yep! reaction is totally fine -- I think that's what's used elsewhere. If we wanted to be really fancy it could even be reactions and take a list :)

In case any passers-by are thinking about picking this up, I think this might look something like:

  • In zerver/lib/outgoing_webhook.py:
    • Parse the new field (reaction) in process_success
    • Make a new function add_response_reaction that's the equivalent of send_response_message
      • While there's already a do_add_reaction in zerver/lib/actions.py, it assumes that you've validated your reaction and done some normalizing. I'm a little fuzzy here, but I think you may want to create a check_reaction and check_add_reaction that are equivalent to check_message and check_send_message and factor out some of the code in add_reaction in zerver/views/reactions.py for them.
    • Call that new add_response_reaction function in process_success_response

Open question: how should this behave if the requested reaction isn't actually an emoji name in that realm? Cancel the reaction but allow any message through? Cancel both?

@timabbott
Copy link
Sponsor Member

For invalid reactions data, I'd expect it to do our semi-standard outgoing webhook error handling of notifying the user who owns the bot, and then abort without doing anything.

@PIG208
Copy link
Member

PIG208 commented Apr 6, 2021

@zulipbot claim

PIG208 added a commit to PIG208/zulip that referenced this issue Apr 12, 2021
PIG208 added a commit to PIG208/zulip that referenced this issue Apr 12, 2021
send_response_reaction is created for the sake of this feature, which is
implemented in a way similar to send_response_message. Since this change,
the outgoing webhooks will be able to respond to messages only with reactions,
though sending a response message at the same time is also supported.

Fixes: zulip#12811
@zulipbot
Copy link
Member

Hello @PIG208, you claimed this issue to work on it, but this issue and any referenced pull requests haven't been updated for 10 days. Are you still working on this issue?

If so, please update this issue by leaving a comment on this issue to let me know that you're still working on it. Otherwise, I'll automatically remove you from this issue in 4 days.

If you've decided to work on something else, simply comment @zulipbot abandon so that someone else can claim it and continue from where you left off.

Thank you for your valuable contributions to Zulip!

@PIG208
Copy link
Member

PIG208 commented Apr 23, 2021

Yes, there is a linked PR waiting for review.

timabbott pushed a commit to PIG208/zulip that referenced this issue Apr 28, 2021
send_response_reaction is created for the sake of this feature, which is
implemented in a way similar to send_response_message. Since this change,
the outgoing webhooks will be able to respond to messages only with reactions,
though sending a response message at the same time is also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue May 9, 2021
send_response_reaction is created for the sake of this feature, which is
implemented in a way similar to send_response_message. Since this change,
the outgoing webhooks will be able to respond to messages only with reactions,
though sending a response message at the same time is also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue May 9, 2021
send_response_reaction is created for the sake of this feature, which is
implemented in a way similar to send_response_message. Since this change,
the outgoing webhooks will be able to respond to messages only with reactions,
though sending a response message at the same time is also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue May 9, 2021
send_response_reaction is created for the sake of this feature, which is
implemented in a way similar to send_response_message. Since this change,
the outgoing webhooks will be able to respond to messages only with reactions,
though sending a response message at the same time is also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue May 10, 2021
send_response_reaction is created for the sake of this feature, which
is implemented in a way similar to send_response_message. Since this
change, the outgoing webhooks will be able to respond to messages only
with reactions, though sending a response message at the same time is
also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue May 10, 2021
send_response_reaction is created for the sake of this feature, which
is implemented in a way similar to send_response_message. Since this
change, the outgoing webhooks will be able to respond to messages only
with reactions, though sending a response message at the same time is
also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue May 10, 2021
send_response_reaction is created for the sake of this feature, which
is implemented in a way similar to send_response_message. Since this
change, the outgoing webhooks will be able to respond to messages only
with reactions, though sending a response message at the same time is
also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue May 10, 2021
send_response_reaction is created for the sake of this feature, which
is implemented in a way similar to send_response_message. Since this
change, the outgoing webhooks will be able to respond to messages only
with reactions, though sending a response message at the same time is
also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue May 10, 2021
send_response_reaction is created for the sake of this feature, which
is implemented in a way similar to send_response_message. Since this
change, the outgoing webhooks will be able to respond to messages only
with reactions, though sending a response message at the same time is
also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue May 11, 2021
send_response_reaction is created for the sake of this feature, which
is implemented in a way similar to send_response_message. Since this
change, the outgoing webhooks will be able to respond to messages only
with reactions, though sending a response message at the same time is
also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue May 12, 2021
send_response_reaction is created for the sake of this feature, which
is implemented in a way similar to send_response_message. Since this
change, the outgoing webhooks will be able to respond to messages only
with reactions, though sending a response message at the same time is
also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue May 16, 2021
send_response_reaction is created for the sake of this feature, which
is implemented in a way similar to send_response_message. Since this
change, the outgoing webhooks will be able to respond to messages only
with reactions, though sending a response message at the same time is
also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue May 17, 2021
send_response_reaction is created for the sake of this feature, which
is implemented in a way similar to send_response_message. Since this
change, the outgoing webhooks will be able to respond to messages only
with reactions, and sending a response message at the same time is
also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue Jun 12, 2021
send_response_reaction is created for the sake of this feature, which
is implemented in a way similar to send_response_message. Since this
change, the outgoing webhooks will be able to respond to messages only
with reactions, and sending a response message at the same time is
also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue Jun 12, 2021
send_response_reaction is created for the sake of this feature, which
is implemented in a way similar to send_response_message. Since this
change, the outgoing webhooks will be able to respond to messages only
with reactions, and sending a response message at the same time is
also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue Jun 12, 2021
send_response_reaction is created for the sake of this feature, which
is implemented in a way similar to send_response_message. Since this
change, the outgoing webhooks will be able to respond to messages only
with reactions and sending a response message at the same time is
also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue Jun 12, 2021
send_response_reaction is created for the sake of this feature, which
is implemented in a way similar to send_response_message. Since this
change, the outgoing webhooks will be able to respond to messages only
with reactions, and sending a response message at the same time is
also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue Jun 14, 2021
send_response_reaction is created for the sake of this feature, which
is implemented in a way similar to `send_response_message`. Since this
change, the outgoing webhooks will be able to respond to messages only
with reactions, and sending a response message at the same time is
also supported.

Fixes: zulip#12811
PIG208 added a commit to PIG208/zulip that referenced this issue Oct 1, 2021
send_response_reaction is created for the sake of this feature, which
is implemented in a way similar to `send_response_message`. Since this
change, the outgoing webhooks will be able to respond to messages only
with reactions, and sending a response message at the same time is
also supported.

Fixes: zulip#12811
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants