Aggiungi 'codebergpost.php'
comandi per aprire in automatico su codeberg delle issue
This commit is contained in:
		
							
								
								
									
										67
									
								
								codebergpost.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								codebergpost.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,67 @@ | ||||
| <?php | ||||
|  | ||||
| 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 <a href=\"https://t.me/' . $usernamegroup . '/' . $replymessageid . '\" target=\"_blank\">è stato scritto</a> da <b>' . $usernamereply . '</b> sul gruppo Telegram chiamato <b><a href=\"https:/t.me/' . $usernamegroup . '/\" target=\"_blank\">' . $grouptitle . '</a></b>.<br />Qui di seguito il messaggio:<br /><br />' . $replymessagetext . '", | ||||
| "closed": false, | ||||
| "labels": [ xxx, xxx ], | ||||
| "milestone": 0, | ||||
| "title": "' . $titolopronto . '" | ||||
| }'; | ||||
|  | ||||
| $ch = curl_init(); | ||||
| curl_setopt($ch, CURLOPT_URL, "https://codeberg.org/api/v1/repos/lealternative/LeAlternative/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, l'errore è stato segnalato in automatico su <b><a href=\"https://codeberg.org/lealternative/LeAlternative/issues\">Codeberg</a></b>, grazie!", | ||||
| 'parse_mode' => 'HTML', | ||||
| 'disable_web_page_preview' => true | ||||
| 	); | ||||
| 	$telegram->sendMessage($content); | ||||
|    | ||||
| } | ||||
|  | ||||
| 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 <a href=\"https://t.me/' . $usernamegroup . '/' . $replymessageid . '\" target=\"_blank\">è stato scritto</a> da <b>' . $usernamereply . '</b> sul gruppo Telegram chiamato <b><a href=\"https:/t.me/' . $usernamegroup . '/\" target=\"_blank\">' . $grouptitle . '</a></b>.<br />Qui di seguito il messaggio:<br /><br />' . $replymessagetext . '", | ||||
| "closed": false, | ||||
| "labels": [ xxx, xxx ], | ||||
| "milestone": 0, | ||||
| "title": "' . $titolopronto . '" | ||||
| }'; | ||||
|  | ||||
| $ch = curl_init(); | ||||
| curl_setopt($ch, CURLOPT_URL, "https://codeberg.org/api/v1/repos/lealternative/LeAlternative/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 <b><a href=\"https://codeberg.org/lealternative/LeAlternative/issues\">Codeberg</a></b>, grazie!", | ||||
| 'parse_mode' => 'HTML', | ||||
| 'disable_web_page_preview' => true | ||||
| 	); | ||||
| 	$telegram->sendMessage($content); | ||||
|    | ||||
| } | ||||
|  | ||||
| ?> | ||||
		Reference in New Issue
	
	Block a user