Untitled

mail@pastecode.io avatar
unknown
python
a year ago
335 B
5
Indexable
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)