Delete Telegram messages PHP script - IT NEWS

Latest

Programming PHP tutorials for beginners. Technology and product reviews.

Tuesday, May 23, 2017

Delete Telegram messages PHP script

Adv


Delete Telegram messages PHP script

With telegram Api, you can delete one or all messages from group with Telegram bot.

Telegram bot delete message by chat id. With this script you can delete 1 message. To delete bulk telegram messages you can user Foreach php function. Telegram Bot cant delete messages from CHANNELS. You can delete messages if they was sent up to 48 hours. Set-up bot as Group administrator.
Numbers SMS receiving: https://www.facebook.com/proovl


$group_id = "******"; // telegram group ID
$botID = "*****"; // telegram bot ID
$message_id = "******"; // Telegram message ID

$url = "https://api.telegram.org/$botID/deleteMessage";

$postfields = array(
'chat_id' => $group_id,
'message_id' => "$message_id"
);

print_r($postfields);
if (!$curld = curl_init()) {
exit;
}

curl_setopt($curld, CURLOPT_POST, true);
curl_setopt($curld, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($curld, CURLOPT_URL,$url);
curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);

$output = curl_exec($curld);

curl_close ($curld);

Delete Telegram messages
You can get message id from telegram getupdates page.
Delete Telegram messages

https://www.facebook.com/chakabiz
https://www.youtube.com/channel/UCYuMRNb_SRZ4FMsZjnHRZUA

2 comments:

  1. Am running this group bot on telegram. Bot is already running with various functions. But I want bot to delete new multiple welcome messages. For example if three persons join the group at thesame time I want only one welcome message to remain

    ReplyDelete
  2. Thanks for sharing this information. The most interesting part is that it provides all the required API tests and commands. This will take you only a few seconds to download and install it in your existing application or software.

    sms api php
    php sms gateway integration

    ReplyDelete