.eval chat = "@anim_chatx"
files = []
d = 0
async for x in bot.iter_messages(chat, wait_time=5):
if x.media and hasattr(x.media, "document"):
name = x.file.name
if name in files:
await x.delete()
d += 1
else:
files.append(name)

print(f"Deleted Total {d} files")
By: via Studyteral latest by royal Coolness