2016-11-17 82 views
1

我有一個懶散的機器人,我使用開發人員賬號爲Slack App在chat.postMessage()上使用Tester發送結構化消息。Slack Bot互動消息。顯示「哦,不,出了點問題,請再試一次。」點擊按鈕點擊

消息得到發送順利,但當按鈕被點擊時,它顯示 - 「哦,不,出了問題,請再試一次。」在聊天窗口中,沒有收到交互式消息請求URL。

我不知道發生了什麼,任何幫助將不勝感激。

消息附件

[ 
    { 
     "title": "The Further Adventures of Slackbot", 
     "fields": [ 
      { 
       "title": "Volume", 
       "value": "1", 
       "short": true 
      }, 
      { 
       "title": "Issue", 
       "value": "3", 
       "short": true 
      } 
     ], 
     "author_name": "Stanford S. Strickland", 
     "author_icon": "http://a.slack-edge.com/7f18/img/api/homepage_custom_integrations-2x.png", 
     "image_url": "http://i.imgur.com/OJkaVOI.jpg?1" 
    }, 
    { 
     "title": "Synopsis", 
     "text": "After @episod pushed exciting changes to a devious new branch back in Issue 1, Slackbot notifies @don about an unexpected deploy..." 
    }, 
    { 
     "fallback": "Would you recommend it to customers?", 
     "title": "Would you recommend it to customers?", 
     "callback_id": "comic_1234_xyz", 
     "color": "#3AA3E3", 
     "attachment_type": "default", 
     "actions": [ 
      { 
       "name": "recommend", 
       "text": "Recommend", 
       "type": "button", 
       "value": "recommend" 
      }, 
      { 
       "name": "no", 
       "text": "No", 
       "type": "button", 
       "value": "bad" 
      } 
     ] 
    } 
] 
+1

檢查您的Slack應用程序中是否啓用了交互式按鈕,並且它指向了您的腳本。 –

+0

嘿Erik Kalkoken!謝謝回覆。 –

+3

嗨,朋友,它現在整理。實際上,我使用的是錯誤的令牌,測試令牌,必須使用通過應用程序的OAuth流獲取的機器人訪問令牌或用戶訪問令牌。 –

回答

0

它現在排序。實際上,我使用的是錯誤的令牌,測試令牌,必須使用通過應用程序的OAuth流獲取的機器人訪問令牌或用戶訪問令牌。