Good day. I am writing in Python and Django working with the telebot library, there was this kind of meaning:

 elif 'message' in data.keys(): if 'text' in data['message'].keys(): chat_id = data['message']['chat']['id'] 

According to him, I could contact with the help of a bot to the user like this code:

 mes = 'Example' bot.send_message(chat_id, mes) 

Now ran into FB. There API is completely confusing and I can not understand where there is an analogue of the chat_id telegram.

  import fbmq bot = fbmq.Page(token) data = json.loads(request.body.decode('utf-8')) try: if 'message' in data.keys(): if 'text' in data['message'].keys(): text = data['message']['text'] message_id = data['message']['mid'] chat_number = data['message']['seq'] elif 'sender' in data['sender'].keys(): if 'id' in data['sender'].keys(): recipient_id = data['sender']['id'] else: mes = 'Error' page.send(recipient_id, mes) return HttpResponse('OK') 

This is the start, please correct, if I do not do that. Because again, I repeat, the documentation is too incomprehensible and it is very difficult to understand, compared to other services

example

In the examples there is one thing, the documentation is completely different, and in the guides the more so all the different

  • What is tangled in it? Everything is just as simple, another nesting is simple, I don’t understand the other, what you have shown as an example, there are other keys that are not in the example - Yaroslav Molchan
  • @YaroslavMolchan Took keys from another example, in this sobsna and confused. - Milkiweed Gtlt
  • So you have an example of the answer, go for it, and not by some example, everything is simple: ['value'] ['from'] ['id'] is the sender's id - Yaroslav Molchan
  • @YaroslavMolchan thanks for the reply) - Milkiweed Gtlt

0