Untitled

mail@pastecode.io avatarunknown
python
a month ago
335 B
4
Indexable
Never
elif mc := match('(?ism)^(clean|clear) all?\s*(\d+)?',text):
        chat = mc.group(2) if mc.group(2) else chat_id
        f=[i.id async for i in c.get_chat_history(chat)]
        chunks = [f[i:i + 100] for i in range(0, len(f), 100)]
        for ids in chunks:
            await sleep(3)
            await c.delete_messages(chat,ids)