@@ -232,6 +232,26 @@ function prosesPesanTeks($message)
232
232
$ response = curl_exec ($ curl );
233
233
curl_close ($ curl );
234
234
$ json2 = json_decode ($ response ,true );
235
+
236
+ $ curl = curl_init ();
237
+ curl_setopt_array ($ curl , array (
238
+ CURLOPT_URL => "https://api.byu.id/api/inbox " ,
239
+ CURLOPT_RETURNTRANSFER => true ,
240
+ CURLOPT_ENCODING => "" ,
241
+ CURLOPT_MAXREDIRS => 10 ,
242
+ CURLOPT_TIMEOUT => 0 ,
243
+ CURLOPT_FOLLOWLOCATION => true ,
244
+ CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1 ,
245
+ CURLOPT_CUSTOMREQUEST => "GET " ,
246
+ CURLOPT_HTTPHEADER => array (
247
+ "msisdn: 61815xxxxxxx " ,
248
+ "Content-Type: application/json " ,
249
+ "Authorization: Bearer ISIKAN_BEARER_TOKEN_DISINI "
250
+ ),
251
+ ));
252
+ $ response = curl_exec ($ curl );
253
+ curl_close ($ curl );
254
+ $ json3 = json_decode ($ response ,true );
235
255
236
256
237
257
//INI SEKAT BIAR GAPUSHINK
@@ -281,6 +301,18 @@ function prosesPesanTeks($message)
281
301
$ text .= " minute` \n\n" ;
282
302
}
283
303
}
304
+
305
+ $ text .= "\n\n📩 *Last Inbox* \n" ;
306
+ if ($ json3 ['data ' ][0 ]['hasRead ' ] == 1 ) {
307
+ $ wisurung = "Already read " ;
308
+ } else {
309
+ $ wisurung = "Unread " ;
310
+ }
311
+ $ text .= "Message ID: ` " .$ json3 ['data ' ][0 ]['id ' ]."` \n" ;
312
+ $ text .= "Title: * " .$ json3 ['data ' ][0 ]['title ' ]."* \n" ;
313
+ $ text .= "Message: " .$ json3 ['data ' ][0 ]['content ' ]."\n" ;
314
+ $ text .= "Time received: ` " .$ json3 ['data ' ][0 ]['timestamp ' ]."` \n" ;
315
+
284
316
$ text .= "`Processed in " .$ hitung ." seconds` " ;
285
317
sendApiMsg ($ chatid , $ text );
286
318
} else {
0 commit comments