Birisi facebook chatbot düğmesi eleman 'yük' alanı ne olduğunu bana açıklayabilir? Ben bot gelişimine yeniyim. Eğer çok örnek sağlayabilir harika olurdu.
facebook sohbet bot yük alanı nedir?
'Yük' alanına bu yük ile bir geri gönderme alındığında her bir eylem aramanı sağlayan bir kullanıcı tanımlı bir alandır.
Örneğin; Ben 2 düğme içerir benim bot içinde kalıcı bir menü oluşturursanız: 'Ev' ve 'İletişim' ve bunların her biri için yük düğmesinin adıyla aynıdır. Bir kullanıcı 'Ana Sayfa' butonuna tıkladığında, bir işlem bildirim yük 'Ev' ile gönderilir. Bu durumda bot 'Ev' kısmına kullanıcı alır bir eylem oluşturabilirsiniz.
: geri göndermeler ve yük hakkında daha fazla bilgi için şu adrese gidin https://developers.facebook.com/docs/messenger-platform/send-api-reference/postback-button https://developers.facebook.com/docs/messenger-platform / webhook referans / geri gönderme Alınan
Geri gönderimi yapan ana 'sonrası' işlevinde bir işlev oluşturmak için emin olun. Aşağıdaki kod Python bir bot öğreticisindeki olduğunu
# 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 ###













