在做一个Facebook聊天机器人时,我遇到了一个错误,即回发只能运行一次,之后我必须刷新页面以便回发工作。
这是我的代码:
page.show_starting_button("START_PAYLOAD")
@page.handle_postback
def received_postback(event):
sender_id = event.sender_id
recipient_id = event.recipient_id
time_of_postback = event.timestamp
payload = event.postback_payload
print("Received postback for user %s and page %s with payload '%s' at %s"
% (sender_id, recipient_id, payload, time_of_postback))
page.send(sender_id, "Postback called")`
提前谢谢