title: Open modal using Slack command
body: <p>I have a Slack command which displays a button. When I click on this button I need to display a modal. For this, after clicking it I do this:</p>
  
  <pre><code>const dialog = {
    callback_id: "submit-ticket",
    elements: [
      {
        hint: "30 second summary of the problem",
        label: "Title",
        name: "title",
        type: "text",
        value: "teste"
      },
      {
        label: "Description",
        name: "description",
        optional: true,
        type: "textarea"
      },
      {
        label: "Urgency",
        name: "urgency",
        options: [
          { label: "Low", value: "Low" },
          { label: "Medium", value: "Medium" },
          { label: "High", value: "High" }
        ],
        type: "select"
      }
    ],
    submit_label: "Submit",
    title: "Submit a helpdesk ticket"
  };
  
  const modalInfo = {
      dialog: JSON.stringify(dialog),
      token, // this is correct
      trigger_id: actionJSONPayload.trigger_id
    };
  
  
    // This is what I get confused with...
  
    // Method 1
    slack.dialog.open(modalInfo).catch(err =&gt; {
      console.log("ERROR: ", err);
    });
    // end method 1
  
    // Method 2
    sendMessageToSlackResponseURL(actionJSONPayload.response_url, modalInfo);
  
  ...
  
  function sendMessageToSlackResponseURL(responseURL: any, JSONmessage: any) {
    const postOptions = {
      headers: {
        "Content-type": "application/json"
      },
      json: JSONmessage,
      method: "POST",
      uri: responseURL
    };
    request(postOptions, (error: any, response: any, body: any) =&gt; {
      if (error) {
        console.log("----Error: ", error);
      }
    });
  }
  // end method 2
  </code></pre>
  
  <p>I get always <code>Error: invalid_trigger</code> using method1 when this trigger is something that my button is generating automatically.</p>
  
  <p>Method 2 doesn't throw any error but doesn't open any modal/dialog either.</p>
  
  <p>The official documentation is not quite clear and I don't know if I need to call dialog.open or views.open. Either way, the last one is not available from <a href="https://www.npmjs.com/package/slack" rel="nofollow noreferrer">Slack package</a></p>
  
  <p>This is also the button I'm displaying before anything:</p>
  
  <pre><code>const message = {
          attachments: [
            {
              actions: [
                {
                  name: "send_sms",
                  style: "danger",
                  text: "Yes",
                  type: "button",
                  value: "yes"
                },
                {
                  name: "no",
                  text: "No",
                  type: "button",
                  value: "no"
                }
              ],
              attachment_type: "default",
              callback_id: "alert",
              color: "#3AA3E3",
              fallback: "We could not load the options. Try later",
              text: "Do you want to alert by SMS about P1 error/fix?"
            }
          ],
          text: "P1 SMSs"
        };
  </code></pre>