How do I get the status of the sent message "ok" and "message_id?
sstifler opened this issue · 1 comments
sstifler commented
telegram method sendmessage returns the response {"ok":true,"result":{"message_id":7661
How do I get the status of the sent message "ok" and "message_id?
It would be logical for TelegramMessage::create() to return a telegram response, but it returns the message before sending
$result = TelegramMessage::create()
// Optional recipient user id.
->to($notifiable)
->options($options)
->content("test msg")
->buttonWithCallback('Test callback button', 'unfollow:unfollow_confirm:');
dd($result);
NotificationChannels\Telegram\TelegramMessage {#1291 ▼ // app\Notifications\SendMsg.php:98
+chunkSize: null
+token: null
#payload: array:5 [▶
"text" => "test msg"
"parse_mode" => "HTML"
"chat_id" => "215050601"
"disable_notification" => true
"reply_markup" => "{"inline_keyboard":[[{"text":"Test callback button","callback_data":"unfollow:unfollow_confirm:"}]]}"
]
#buttons: array:1 [▶
0 => array:2 [▶
"text" => "Test callback button"
"callback_data" => "unfollow:unfollow_confirm:"
]
]
}
irazasyed commented
Use notification events as mentioned in docs Handling Response.