Added use utf8 and added debug message to trace Telegram transport problems
This commit is contained in:
parent
f4c57e53db
commit
106bb9f800
@ -1,6 +1,7 @@
|
||||
package Mnemosyne::Webhook;
|
||||
use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
use DateTime;
|
||||
use Mnemosyne::Task;
|
||||
use Mnemosyne::Digest;
|
||||
@ -30,6 +31,11 @@ sub handle_update {
|
||||
return;
|
||||
}
|
||||
|
||||
my $upd_type = exists $update->{message} ? 'message'
|
||||
: exists $update->{callback_query} ? 'callback_query'
|
||||
: 'unknown';
|
||||
warn "DBG update type=$upd_type chat=$chat_id\n";
|
||||
|
||||
if (my $msg = $update->{message}) {
|
||||
_handle_message($msg, $chat_id, $db, $config, $telegram);
|
||||
} elsif (my $cbq = $update->{callback_query}) {
|
||||
@ -84,6 +90,7 @@ sub _handle_callback {
|
||||
my ($cbq, $chat_id, $db, $config, $telegram) = @_;
|
||||
my $data = $cbq->{data} // '';
|
||||
my $cbq_id = $cbq->{id};
|
||||
warn "DBG handle_callback: data=$data\n";
|
||||
my $msg = $cbq->{message} // {};
|
||||
my $msg_id = $msg->{message_id};
|
||||
|
||||
@ -438,6 +445,7 @@ sub _wizard_text {
|
||||
sub _wizard_callback {
|
||||
my ($data, $cbq_id, $chat_id, $msg_id, $db, $config, $telegram) = @_;
|
||||
my $sess = $SESSIONS{$chat_id};
|
||||
warn "DBG wizard_callback: data=$data sess=" . ($sess ? $sess->{step} : 'NONE') . "\n";
|
||||
|
||||
# If no session but wizard callback arrives, ignore gracefully
|
||||
unless ($sess) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user