facebookのchatbotボタン要素の「ペイロード」フィールドは何ですか?私はボット開発の新人です。あまりにも例を挙げることができれば素晴らしいだろう。facebook chat botのペイロードフィールドとは何ですか?
0
A
答えて
0
'payload'フィールドは、このペイロードを持つポストバックが受信されるたびにアクションを呼び出すことができるユーザー定義フィールドです。
例えば、ボットに「ホーム」と「連絡先」の2つのボタンを含む永続的なメニューを作成すると、それぞれのペイロードはボタンの名前と同じになります。ユーザが「ホーム」ボタンをクリックすると、ペイロード「ホーム」とともにポストバックが送信されます。その場合、ユーザーをボットの「ホーム」部分に移動させるアクションを作成することができます。ポストバックとペイロードの詳細について
、に行く: https://developers.facebook.com/docs/messenger-platform/send-api-reference/postback-button https://developers.facebook.com/docs/messenger-platform/webhook-reference/postback-received
は、ポストバックを処理し、あなたのメインの「ポスト」関数で関数を作成することを確認してください。以下のコードは、Pythonのボットのチュートリアルです。
# 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. Skype chat bot framework-node.js
- 2. URLを検証できませんでしたFacebook Messenger Chat Bot
- 3. Facebook chat bot同じメッセージを複数回送信する(Python)
- 4. Microsoft Bot Framework、web chat platformのクイック返信
- 5. Facebook chat on website
- 6. Google botガードスパムとは何ですか?
- 7. node.jsのWit.ai chat botとの会話を開始
- 8. facebook chatで受信メッセージをキャプチャする
- 9. facebook messenger botエンコーディングエラー
- 10. Facebook Messenger Bot
- 11. public facebook Messenger Bot
- 12. botフレームワークでのExcelファイルのパスとは何ですか?
- 13. Telegeram Botの `msg.chat.id`と` msg.from.id`の違いは何ですか?
- 14. Facebook messenger bot review process
- 15. Meteor Facebook Messenger Bot webhook
- 16. Microsoft Bot Framework C#のDialogModule.BeginLifeTimeScopeとは何ですか?
- 17. facebook chat cantはアンドロイドのsmack apiで動作します
- 18. facebookチャットアプリケーションの「チャンネル」とは何ですか?
- 19. プロキシFacebookファイアウォールをバイパスするchat
- 20. Facebookページタブアプリ(タイムライン)のfacebook要素(nav、chat)をカバーするFlashオブジェクト
- 21. FacebookのBOTウェブフックの統合
- 22. facebook messenger botのペイロードとはどのように扱うのですか?
- 23. ajaxとjQuery chat
- 24. facebook messenger botのユーザーセッションを維持することは可能ですか?
- 25. AsyncFacebookRunnerの代替クラスとは何ですか?Facebook SDKのFacebookも
- 26. Lets-Chatでテンプレートエンジンは何を使用していますか?
- 27. Facebookデベロッパーコンソールとは何ですか?
- 28. facebook messenger botとデータベースを統合
- 29. facebook messenger botでエラーが発生する
- 30. facebook messenger botにカスタムグラフを表示することはできますか?