Bots 按照说明操作时,WAS Slackbot集成来自WAS登录页错误

Bots 按照说明操作时,WAS Slackbot集成来自WAS登录页错误,bots,ibm-watson,slack,watson-assistant-solutions,Bots,Ibm Watson,Slack,Watson Assistant Solutions,“” 我无法通过遵循WAS Slack Bot集成的步骤(上面的链接)使其工作 当我尝试使用相同的ID和API令牌成功连接到另一个程序时,我的松弛设置应该是正常的 我最初安装了Python3.7,但按照文档建议降级到3.6.2 “python3 bot.py”结果如下-带有异常堆栈 Forests-MacBook-Pro:simple_WA_slackbot fmlin$ python3 bot.py Not On Bluemix... Environment Variables Loaded

“”

我无法通过遵循WAS Slack Bot集成的步骤(上面的链接)使其工作

  • 当我尝试使用相同的ID和API令牌成功连接到另一个程序时,我的松弛设置应该是正常的

  • 我最初安装了Python3.7,但按照文档建议降级到3.6.2

  • “python3 bot.py”结果如下-带有异常堆栈

    Forests-MacBook-Pro:simple_WA_slackbot fmlin$ python3 bot.py
    Not On Bluemix...
    Environment Variables Loaded Successfully
    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/slackclient/server.py", line 179, in connect_slack_websocket
        http_proxy_auth=proxy_auth)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/websocket/_core.py", line 494, in create_connection
        websock.connect(url, **options)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/websocket/_core.py", line 217, in connect
        options.pop('socket', None))
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/websocket/_http.py", line 126, in connect
        sock = _ssl_socket(sock, options.sslopt, hostname)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/websocket/_http.py", line 253, in _ssl_socket
        sock = _wrap_sni_socket(sock, sslopt, hostname, check_hostname)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/websocket/_http.py", line 232, in _wrap_sni_socket
        server_hostname=hostname,
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 401, in wrap_socket
        _context=self, _session=session)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 808, in __init__
        self.do_handshake()
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1061, in do_handshake
        self._sslobj.do_handshake()
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 683, in do_handshake
        self._sslobj.do_handshake()
    ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748)
    
  • 在处理上述异常期间,发生了另一个异常:

    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/slackclient/client.py", line 52, in rtm_connect
        self.server.rtm_connect(use_rtm_start=with_team_state, **kwargs)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/slackclient/server.py", line 147, in rtm_connect
        self.connect_slack_websocket(self.ws_url)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/slackclient/server.py", line 186, in connect_slack_websocket
        raise SlackConnectionError(message=str(e))
    slackclient.server.SlackConnectionError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748)
    Connection failed. Invalid Slack token or bot ID?
    Forests-MacBook-Pro:simple_WA_slackbot fmlin$ 
    

    尝试运行
    /Applications/Python 3.6.2/Install Certificates.command
    程序来安装验证SSL连接所需的根证书,因为Python安装的SSL证书验证似乎失败了


    确保使用了正确的机器人ID

    是否在.env文件中设置了用户环境变量BOT_ID

    您是否使用说明中的说明正确创建了处于松弛状态的bot

    拿到你的钥匙

    Go to https://YOUR_SLACK.slack.com/apps/manage
    In the Search App Directory field at the top, type Bots
    Click on Bots
    Click on the Add Configuration button
    Give your bot a unique username (Save this info)
    Save the API Token
    You will use these variables when creating your .env file as instructed in the below steps
    

    非常感谢,阿迪尔。这真的很有帮助!现在工作。