我正在尝试对某些用户输入使用open.dialog方法,问题是一旦用户填写字段对话框并停留并引发错误“我们在连接时遇到问题。请重试?”
我将Django + restframework用于命令和对话框的URL。
我曾尝试发送200的空尸体,但这也不起作用。
return Response(data='',status=status.HTTP_200_OK)
def post(self, request, *args, **kwargs):
slack_message = request.data
payload = json.loads(slack_message.get('payload'))
channel = payload["channel"]["id"]
if payload['type'] == "dialog_submission":
return Response(status=status.HTTP_200_OK) # responding to slack with 200
# below is rest of the code which does not work.
if payload['token']==SLACK_VERIFICATION_TOKEN:
sc.api_call('chat.postMessage',
channel=channel,
text="we are working on your request , will update you shortly :)")
summary = payload["submission"]["summary"]
user_id = payload["user"]["id"]
答案 0 :(得分:0)
请尝试发送HTTP 204,因为这是没有内容的响应。它将正常工作。
答案 1 :(得分:0)
尝试一下:
return {"isBase64Encoded": True, "statusCode": 200, "headers": { }, "body": ""}
这对我有用。