Closed iSapozhnik closed 4 years ago
@cipi1965 Hey! So here is the JSON when update location event occurs:
{
"update_id" : 708184783,
"edited_message" : {
"chat" : {
"username" : "iSapozhnik",
"id" : 38057730,
"last_name" : "Sapozhnik",
"type" : "private",
"first_name" : "Ivan"
},
"date" : 1575935185,
"message_id" : 106,
"edit_date" : 1575935280,
"location" : {
"longitude" : 11.614706999999999,
"latitude" : 48.138272999999998
},
"from" : {
"username" : "iSapozhnik",
"id" : 38057730,
"last_name" : "Sapozhnik",
"language_code" : "en",
"is_bot" : false,
"first_name" : "Ivan"
}
}
}
At the moment when I just starting live location sharing I get this:
▿ {
"update_id" : 708184781,
"message" : {
"chat" : {
"username" : "iSapozhnik",
"id" : 38057730,
"last_name" : "Sapozhnik",
"type" : "private",
"first_name" : "Ivan"
},
"date" : 1575935185,
"message_id" : 106,
"location" : {
"longitude" : 11.614713999999999,
"latitude" : 48.138297000000001
},
"from" : {
"username" : "iSapozhnik",
"id" : 38057730,
"last_name" : "Sapozhnik",
"language_code" : "en",
"is_bot" : false,
"first_name" : "Ivan"
}
}
}
@iSapozhnik ok i see, i think i know why it does not work, location type in router consider only message and not edited_message. Tomorrow i will give a look
@cipi1965 Thanks!
Hey there! I'm note really sure what is the best way to handle live location updates, can somebody help me here?
So what I'm trying to achieve is following: when the user shares his live location I want my bot to do something every time when the location changes. When I just start sharing my live location, first event I can handle by doing
But when the new location comes I get
Unsupported content type
. Is there is another way to catch this events exceptrouter.unsupportedContentType = { context in }
handler?Thanks in advance.