问题描述
我想构建一个可以检索频道聊天历史记录的 Slack 机器人,但即使我已经添加了它,我也面临 missing_scope 错误消息:
Error creating conversation: The request to the Slack API Failed.
The server responded with: {'ok': False,'error': 'missing_scope','needed': 'groups:history','provided': 'identify,bot:basic'}
我检查了我的 App/OAuth&Permissions 并添加了 groups:history 范围(附上图片),但我仍然面临这个问题。我的应用具有以下范围:“bot”、“channels:history”、“chat:write:bot”、“groups:history”、“im:history”、“mpim:history”。
我的代码只是调用了对话历史 API。服务器/客户端连接一切正常,因为我可以执行其他 API 调用,例如 chat_postMessage。
try:
result = await web_client.conversations_history(channel=channel_id,latest=from_sse,oldest=to_sse)
conversation_history = result["messages"]
print("{} messages found in {}".format(len(conversation_history),id))
except SlackApiError as e:
print("Error creating conversation: {}".format(e))
有什么想法吗?提前致谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)