페이스 북의 chatbot 버튼 요소에서 '페이로드'필드가 무엇인지 설명 할 수 있습니까? 나는 봇 개발에 익숙하지 않다. 당신도 예제를 제공 할 수 있다면 좋을 것입니다.facebook chat 봇 페이로드 필드 란 무엇입니까?
0
A
답변
0
'payload'필드는이 페이로드가있는 포스트 백이 수신 될 때마다 작업을 호출 할 수있게 해주는 사용자 정의 필드입니다.
예 : 봇에 '홈'과 '연락처'버튼이 두 개있는 영구 메뉴를 만들고 각 메뉴의 페이로드가 버튼의 이름과 같습니다. 사용자가 '홈'버튼을 클릭하면 페이로드가 '집'으로 다시 게시됩니다. 이 경우 사용자를 봇의 '집'부분으로 이동시키는 작업을 만들 수 있습니다. https://developers.facebook.com/docs/messenger-platform/send-api-reference/postback-button https://developers.facebook.com/docs/messenger-platform/webhook-reference/postback-received
가 포스트 백을 처리하는 주요 '포스트'기능에서 함수를 작성해야합니다 :
는 포스트 백 및 페이로드에 대한 자세한 내용은로 이동합니다. 아래의 코드는 파이썬의 봇 자습서에서 얻은 것입니다.# Post function to handle facebook messages
def post(self, request, *args, **kwargs):
# converts the text payload into a python dictionary
incoming_message = json.loads(self.request.body.decode('utf-8'))
# facebook recommends going through every entry since they might send
# multiple messages in a single call during high load
for entry in incoming_message['entry']:
for message in entry['messaging']:
# check to make sure the received call is a message call
# this might be delivery, optin, postback for other events
if 'message' in message:
pprint(message)
### add here the rest of the code that will be handled when the bot receives a message ###
if 'postback' in message:
# print the message in terminal
pprint(message)
### add here the rest of the code that will be handled when the bot receives a postback ###
관련 문제
- 1. Facebook Chat 봇 이제 XMPP로 가능합니까?
- 2. 페이로드 란 무엇입니까?
- 3. facebook chat for android
- 4. facebook chat in silverlight
- 5. facebook chat like
- 6. Facebook xmpp chat message
- 7. Facebook Chat Api와 이모티콘
- 8. Facebook Chat XMPP 프로토콜
- 9. facebook 엽서 및 페이로드
- 10. Facebook 메신저 봇
- 11. facebook 메신저 봇 템플릿
- 12. facebook chat with pure ruby
- 13. Facebook Chat API 및 OpenGraph
- 14. facebook chat 같은 이미지 이동
- 15. Android Facebook chat 예제 프로젝트
- 16. PHP stream_socket_client 및 facebook chat
- 17. Facebook Objective-C Chat API
- 18. Facebook Chat API - 이메일로 로그인
- 19. facebook chat API로 로그인하지 못했습니다.
- 20. 대화 형 facebook 메신저 봇
- 21. CCK 계산 필드 란 무엇입니까?
- 22. 필드 순차 3D 란 무엇입니까?
- 23. Oracle 숨겨진 필드 란 무엇입니까?
- 24. 데이터베이스 NULL 필드 란 무엇입니까?
- 25. 불투명 한 필드 란 무엇입니까?
- 26. Java의 합성 필드 란 무엇입니까?
- 27. 채팅 봇 (Facebook for Messaging)
- 28. facebook 메신저 봇 인코딩 오류
- 29. Facebook 메신저 봇 - 공유 버튼
- 30. 열려있을 때 Facebook chat hide Flash 앱