How to combine slash commands, buttons and dialogs for a menu?











up vote
0
down vote

favorite












My Slack app is started with a slash command, which then posts an ephemeral menu message to the user. That menu has some information and three message buttons.



Example:



enter image description here




  • First button allows the user to close the menu

  • Second button allows the user to start an action

  • Third button allows the user to open a dialog for changing
    options.


After the user submits the dialog I want to update the menu message to reflect the changes made in the dialog.



However, after the user submits the dialog I can no longer to update the message menu by responding to a Slack response as before.



How can I update the menu message with the changes?










share|improve this question




























    up vote
    0
    down vote

    favorite












    My Slack app is started with a slash command, which then posts an ephemeral menu message to the user. That menu has some information and three message buttons.



    Example:



    enter image description here




    • First button allows the user to close the menu

    • Second button allows the user to start an action

    • Third button allows the user to open a dialog for changing
      options.


    After the user submits the dialog I want to update the menu message to reflect the changes made in the dialog.



    However, after the user submits the dialog I can no longer to update the message menu by responding to a Slack response as before.



    How can I update the menu message with the changes?










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      My Slack app is started with a slash command, which then posts an ephemeral menu message to the user. That menu has some information and three message buttons.



      Example:



      enter image description here




      • First button allows the user to close the menu

      • Second button allows the user to start an action

      • Third button allows the user to open a dialog for changing
        options.


      After the user submits the dialog I want to update the menu message to reflect the changes made in the dialog.



      However, after the user submits the dialog I can no longer to update the message menu by responding to a Slack response as before.



      How can I update the menu message with the changes?










      share|improve this question















      My Slack app is started with a slash command, which then posts an ephemeral menu message to the user. That menu has some information and three message buttons.



      Example:



      enter image description here




      • First button allows the user to close the menu

      • Second button allows the user to start an action

      • Third button allows the user to open a dialog for changing
        options.


      After the user submits the dialog I want to update the menu message to reflect the changes made in the dialog.



      However, after the user submits the dialog I can no longer to update the message menu by responding to a Slack response as before.



      How can I update the menu message with the changes?







      slack slack-api slack-dialog






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 10 at 19:10

























      asked Nov 10 at 19:03









      Erik Kalkoken

      11.5k32145




      11.5k32145
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          In order to keep the connection with the initial slash command one needs to store the response_url of the last interactive action before opening the dialog.



          In this example it will be in the interactive action request initiated after pressing the "Options" button. That response_url allows one to seamlessly continue the conversation that was started with the initial slash command.



          The easiest approach for storing the response_url is to put it into the state property of the dialog, which will automatically be echoed back to the app with the dialog submission request.



          One needs to be careful not to confuse the response_url from the interactive action with the response_url from the dialog.



          Also, the dialog cancel case is automatically handled, since in that case the user can continue working with the initial menu message.






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242419%2fhow-to-combine-slash-commands-buttons-and-dialogs-for-a-menu%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote



            accepted










            In order to keep the connection with the initial slash command one needs to store the response_url of the last interactive action before opening the dialog.



            In this example it will be in the interactive action request initiated after pressing the "Options" button. That response_url allows one to seamlessly continue the conversation that was started with the initial slash command.



            The easiest approach for storing the response_url is to put it into the state property of the dialog, which will automatically be echoed back to the app with the dialog submission request.



            One needs to be careful not to confuse the response_url from the interactive action with the response_url from the dialog.



            Also, the dialog cancel case is automatically handled, since in that case the user can continue working with the initial menu message.






            share|improve this answer

























              up vote
              0
              down vote



              accepted










              In order to keep the connection with the initial slash command one needs to store the response_url of the last interactive action before opening the dialog.



              In this example it will be in the interactive action request initiated after pressing the "Options" button. That response_url allows one to seamlessly continue the conversation that was started with the initial slash command.



              The easiest approach for storing the response_url is to put it into the state property of the dialog, which will automatically be echoed back to the app with the dialog submission request.



              One needs to be careful not to confuse the response_url from the interactive action with the response_url from the dialog.



              Also, the dialog cancel case is automatically handled, since in that case the user can continue working with the initial menu message.






              share|improve this answer























                up vote
                0
                down vote



                accepted







                up vote
                0
                down vote



                accepted






                In order to keep the connection with the initial slash command one needs to store the response_url of the last interactive action before opening the dialog.



                In this example it will be in the interactive action request initiated after pressing the "Options" button. That response_url allows one to seamlessly continue the conversation that was started with the initial slash command.



                The easiest approach for storing the response_url is to put it into the state property of the dialog, which will automatically be echoed back to the app with the dialog submission request.



                One needs to be careful not to confuse the response_url from the interactive action with the response_url from the dialog.



                Also, the dialog cancel case is automatically handled, since in that case the user can continue working with the initial menu message.






                share|improve this answer












                In order to keep the connection with the initial slash command one needs to store the response_url of the last interactive action before opening the dialog.



                In this example it will be in the interactive action request initiated after pressing the "Options" button. That response_url allows one to seamlessly continue the conversation that was started with the initial slash command.



                The easiest approach for storing the response_url is to put it into the state property of the dialog, which will automatically be echoed back to the app with the dialog submission request.



                One needs to be careful not to confuse the response_url from the interactive action with the response_url from the dialog.



                Also, the dialog cancel case is automatically handled, since in that case the user can continue working with the initial menu message.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 10 at 19:03









                Erik Kalkoken

                11.5k32145




                11.5k32145






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242419%2fhow-to-combine-slash-commands-buttons-and-dialogs-for-a-menu%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Bressuire

                    Vorschmack

                    Quarantine