slack rtm_connect没有返回输出

问题描述 投票:0回答:1

当运行slack bot失败时出现以下错误,同时api_calls api.test,auth.test似乎工作正常,任何想法如何解决?我错过了什么吗?

错误:

 No handlers could be found for logger "slackclient.client"
 Connection Failed

代码片段:

from slackclient import SlackClient
import os


slack_token = os.environ["SLACKBOT_LUMBERGH_TOKEN"]
sc = SlackClient(slack_token)

if sc.rtm_connect():
    while sc.server.connected is True:
        print sc.rtm_read()
        time.sleep(1)
else:
    print "Connection Failed"

当我添加

print slack_client.api_call("api.test")
print slack_client.api_call("auth.test")

它返回值。我错过了什么吗?

谢谢!

python slack
1个回答
0
投票

我将python和pip升级到最新,之后运行顺利。

© www.soinside.com 2019 - 2024. All rights reserved.