check callback_query first
This commit is contained in:
parent
11fafe4bcc
commit
2d2ec55f03
@ -34,8 +34,11 @@ sub handle_update {
|
|||||||
|
|
||||||
warn "DBG full_update: " . encode_json($update) . "\n";
|
warn "DBG full_update: " . encode_json($update) . "\n";
|
||||||
|
|
||||||
my $upd_type = exists $update->{message} ? 'message'
|
# callback_query is checked first: Telegram occasionally sends a stub
|
||||||
: exists $update->{callback_query} ? 'callback_query'
|
# top-level "message" key alongside callback_query updates, so existence
|
||||||
|
# of "message" alone is not a reliable discriminator.
|
||||||
|
my $upd_type = exists $update->{callback_query} ? 'callback_query'
|
||||||
|
: exists $update->{message} ? 'message'
|
||||||
: 'unknown';
|
: 'unknown';
|
||||||
warn "DBG update type=$upd_type chat=$chat_id\n";
|
warn "DBG update type=$upd_type chat=$chat_id\n";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user