Script Wraper
Open in Telegram
Download All New Latest Theme, Plugins, Scripts & Codes Only On "Script Wrap" Stay With "Script Wrap" & Get 👇 👉Premium Script 👉Premium Theme 👉Premium Plugins 👉Premium Codes
Show more794
Subscribers
No data24 hours
No data7 days
No data30 days
Posts Archive
Send names here 5 names selected for giveaway......
send only real or your account name only
Visit Our Site For Learn Coding -
Link - https://www.karancoder.tech
This site in under Construction so don't complaint
Our blog website coming in 2 or 3 days...
There i'll post about all types of telegram bot making tutorial..
Python Pyrogram Script for delete channel messages
File Name -
sesson_login.py
Code - from pyrogram import Client
api_id = "API ID" # visit https://my.telegram.org
api_hash = "API HASH" # visit https://my.telegram.org
app = Client("my_account", api_id=api_id, api_hash=api_hash)
app.run()
File Name - main.py
Code - from pyrogram import Client
app = Client("my_account")
# Create a Pyrogram client
# Replace "my_account" with your actual API credentials
with Client("my_account") as app:
# Get information about the channel
channel_name = "@AirdOpsArena" # Here Channel Name
from_id = 1 # message id from where you want to start delete message
last_id = 100 # last messag id for delete message
channel_info = app.get_chat(channel_name)
chat_id = channel_info.id
# Prepare a list of message IDs to be deleted
message_ids_to_delete = list(range(from_id, last_id))
# Delete the messages in batches of 100
for i in range(0, len(message_ids_to_delete), 100):
batch = message_ids_to_delete[i:i + 100]
app.delete_messages(chat_id, batch)
print("All specified messages have been deleted.")
Join - @KaranCoder