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 message action to copy message to input as reply #548

Merged

Conversation

mrsimpson
Copy link
Member

@mrsimpson mrsimpson commented Nov 14, 2018

Motivation

As a developer of a bot, I want to suggest a response to the user. Instead of just making the user to send a fully predefined message, the user shall adjust the message (think of it as a template for the reply).
This reduces typing overhead, reduces errors during the conversation and makes sure the user follows some expected structure

Implementation

There already was a message-action to send a message by clicking a button living in an attachment.
This enhancement allows to create an action button (either from an integration, an API or a bot) which copies a predefined message as template into the message input (browser only!)

Consumption

The button is part of an attachment's actions and can be created anywhere there is a message being created.
Sample for an outgoing integration

class Script{
  
    prepare_outgoing_request({ request }) {

      return {
        message: {
          text: "Would you be so kind to let me know what you did today?",
          attachments[{
            actions: [
              {
                type: "button",
                msg_in_chat_window: true,
                msg_processing_type: "respondWithMessage",
                text: "Respond easily",
                msg: "**What I worked on today**\n- \n\n**What I am planning to do tomorrow**\n- "
              }
            ]
            }]
        }
      }
    }
}

How it looks like

Sample: A Daily-Bot is gathering input from users:
2018-11-15 08 08 01

Open issues

Mobile adaption - since this is a client side action, the mobile apps would have to implement this copy-to-input as well.

@ghost ghost assigned mrsimpson Nov 14, 2018
@ghost ghost added the progress:working label Nov 14, 2018
@mrsimpson mrsimpson requested a review from a team November 14, 2018 22:51
@mrsimpson
Copy link
Member Author

Port nach RC core: RocketChat#12626

@jschirrmacher jschirrmacher merged commit f798a62 into merge/0.70.0 Nov 15, 2018
@ghost ghost removed the progress:working label Nov 15, 2018
@jschirrmacher jschirrmacher deleted the feature/message-action-respond-with-message branch November 15, 2018 12:21
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.

None yet

2 participants