PHP ile Telegram API Kullanarak Mesaj Silmek

24 Haziran 2023 275 Okuma süresi: 15 saniye
function deleteMessage($token, $chatId, $messageId){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "https://api.telegram.org/bot{$token}/deleteMessage");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
        'chat_id' => $chatId,
        'message_id' => $messageId
    ]));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    curl_exec($ch);
}

Benzer makaleler