0

I've got the following program, but can't figure out how to delete the buttons, or preferably the whole message, after the user has clicked one of the buttons?

  const dialog = new BotkitConversation(BLIND_UPDOWN_DIALOG, controller)

  dialog.addQuestion(
    {
      text: 'What did you want to do?',
      action: 'complete',
      blocks: async (template, vars) => {
        return [
          {
            type: 'section',
            text: {
              type: 'plain_text',
              text: 'What did you want to do?',
            },
          },
          {
            type: 'actions',
            elements: [
              {
                type: 'button',
                text: {
                  type: 'plain_text',
                  text: '⬆️ Raise blinds',
                },
                value: 'up',
              },
              {
                type: 'button',
                text: {
                  type: 'plain_text',
                  text: '⬇️ Lower blinds',
                },
                value: 'down',
              },
              {
                type: 'button',
                text: {
                  type: 'plain_text',
                  text: '❌ Cancel',
                },
                value: 'cancel',
              },
            ],
          },
        ]
      },
    },
    async (response, convo, bot, b) => {
      console.log('response', convo, b)
      await bot.say('Oh your response is ' + response)
    },
    'blindCommand'
  )

  controller.addDialog(dialog)
Design by Adrian
  • 2,185
  • 1
  • 20
  • 22
  • Possible duplicate of [How to replace the buttons (attachment) only w/ Slack interactive buttons response](https://stackoverflow.com/questions/42793220/how-to-replace-the-buttons-attachment-only-w-slack-interactive-buttons-respon) – Erik Kalkoken Oct 08 '19 at 09:33
  • @ErikKalkoken No, I'm not interfacing with the Slack API directly, but through BotKit, as implied by the title and tags of this post. – Design by Adrian Oct 08 '19 at 11:20
  • Ah ok. But the principle should be the same. – Erik Kalkoken Oct 08 '19 at 12:06
  • The conversation feature of BotKit doesn't reveal the message ID, so there is no clear of telling Slack what to delete. – Design by Adrian Oct 08 '19 at 12:22

0 Answers0