diff --git a/codebergpost.php b/codebergpost.php index 51bbe30..018a156 100644 --- a/codebergpost.php +++ b/codebergpost.php @@ -4,7 +4,7 @@ if ($userID == 'xxx' || $userID == 'xxx' AND stripos($text, "/bug") === 0) { $titolopronto = substr($text, 4); $codeberg = '{ "assignee": "xxx", -"body": "Questo post è creato automaticamente da un bot. Questo messaggio è stato scritto da ' . $usernamereply . ' sul gruppo Telegram chiamato ' . $grouptitle . '.
Qui di seguito il messaggio:

' . $replymessagetext . '", +"body": "Questo post è creato automaticamente da un bot. Questo messaggio è stato scritto da ' . $usernamereply . ' sul gruppo Telegram chiamato ' . $grouptitle . '.
Qui di seguito il messaggio:

' . $replymessagetext . '", "closed": false, "labels": [ xxx, xxx ], "milestone": 0, @@ -36,7 +36,7 @@ if ($userID == 'xxx' || $userID == 'xxx' AND stripos($text, "/new") === 0) { $titolopronto = substr($text, 4); $codeberg = '{ "assignee": "xxx", -"body": "Questo post è creato automaticamente da un bot. Questo messaggio è stato scritto da ' . $usernamereply . ' sul gruppo Telegram chiamato ' . $grouptitle . '.
Qui di seguito il messaggio:

' . $replymessagetext . '", +"body": "Questo post è creato automaticamente da un bot. Questo messaggio è stato scritto da ' . $usernamereply . ' sul gruppo Telegram chiamato ' . $grouptitle . '.
Qui di seguito il messaggio:

' . $replymessagetext . '", "closed": false, "labels": [ xxx, xxx ], "milestone": 0, @@ -64,4 +64,36 @@ $content = array( } +if ($userID == 'xxx' || $userID == 'xxx' AND stripos($text, "/carte") === 0) { +$titolopronto = substr($text, 6); +$codeberg = '{ +"assignee": "lealternative", +"body": "Questo post è creato automaticamente da un bot. Questo messaggio è stato scritto da ' . $usernamereply . ' sul gruppo Telegram chiamato ' . $grouptitle . '.
Qui di seguito il messaggio:

' . $replymessagetext . '", +"closed": false, +"labels": [ xxx ], +"milestone": 0, +"title": "' . $titolopronto . '" +}'; + +$ch = curl_init(); +curl_setopt($ch, CURLOPT_URL, "https://codeberg.org/api/v1/repos/lealternative/pages/issues?access_token=xxx"); +curl_setopt($ch, CURLOPT_POST, 1); +curl_setopt($ch, CURLOPT_HTTPHEADER, array('accept: application/json','Content-Type: application/json')); +curl_setopt($ch, CURLOPT_POSTFIELDS, $codeberg ); +$response = curl_exec($ch); +curl_close($ch); + +echo $response; + +$content = array( + 'chat_id' => $chat_id, + 'reply_to_message_id' => $replymessageid, + 'text' => "Ok, il suggerimento è stato segnalato in automatico su Codeberg, grazie!", +'parse_mode' => 'HTML', +'disable_web_page_preview' => true + ); + $telegram->sendMessage($content); + +} + ?> \ No newline at end of file