Example #1
0
async def _(event):
    await event.edit("Counting...")
    count = -1
    message = event.message
    while message:
        reply = await message.get_reply_message()
        if reply is None:
            await borg(
                SaveDraftRequest(await event.get_input_chat(),
                                 "",
                                 reply_to_msg_id=message.id))
        message = reply
        count += 1
    await event.edit(f"Chain length: {count}")
Example #2
0
async def _(event):
    if event.fwd_from:
        return
    await event.reply("Counting...")
    count = -1
    message = event.message
    while message:
        reply = await message.get_reply_message()
        if reply is None:
            await event.client(
                SaveDraftRequest(await event.get_input_chat(),
                                 "",
                                 reply_to_msg_id=message.id))
        message = reply
        count += 1
    await event.reply(f"Chain length: {count}")
Example #3
0
async def _(event):
    if event.fwd_from:
        return
    pokemonlub = await edit_or_reply(event, "Counting...")
    count = -1
    message = event.message
    while message:
        reply = await message.get_reply_message()
        if reply is None:
            await borg(
                SaveDraftRequest(await event.get_input_chat(),
                                 "",
                                 reply_to_msg_id=message.id))
        message = reply
        count += 1
    await pokemonlub.edit(f"Chain length: {count}")
Example #4
0
async def _(event):
    if event.fwd_from:
        return
    await event.edit("جـاري كشـف معلومـات الـرسالة 𖠕...")
    count = -1
    message = event.message
    while message:
        reply = await message.get_reply_message()
        if reply is None:
            await event.client(
                SaveDraftRequest(await event.get_input_chat(),
                                 "",
                                 reply_to_msg_id=message.id))
        message = reply
        count += 1
    await event.edit(f" مـعلومـات هـية: {count} 𖠕")
Example #5
0
async def _(event):
    if event.fwd_from:
        return
    hell = await eor(event, "Counting...")
    count = -1
    message = event.message
    while message:
        reply = await message.get_reply_message()
        if reply is None:
            await event.client(
                SaveDraftRequest(await event.get_input_chat(),
                                 "",
                                 reply_to_msg_id=message.id))
        message = reply
        count += 1
    await hell.edit(f"⛓️ **Chain length :**  `{count}`")
Example #6
0
File: rdod.py Project: hsein120/1
async def _(event):
    if event.fwd_from:
        return
    await event.edit("**⌔∮ يتم حساب الردود.**")
    count = -1
    message = event.message
    while message:
        reply = await message.get_reply_message()
        if reply is None:
            await event.client(
                SaveDraftRequest(await event.get_input_chat(),
                                 "",
                                 reply_to_msg_id=message.id))
        message = reply
        count += 1
    await event.edit(f"**⌔∮ ردود الرساله :** {count}")
Example #7
0
async def _(event):
    cache = global_cache[event.chat_id]

    message = event.reply_to_msg_id
    count = 0
    while message is not None:
        reply = cache.get(message, -1)
        if reply == -1:
            reply = None
            if m := await borg.get_messages(event.chat_id, ids=message):
                reply = m.reply_to_msg_id
                cache[message] = reply
                if len(cache) % 10 == 0:
                    await event.edit(
                        f"Counting... ({len(cache)} cached entries)")

        if reply is None:
            await borg(
                SaveDraftRequest(await event.get_input_chat(),
                                 "",
                                 reply_to_msg_id=message))

        message = reply
        count += 1
Example #8
0
async def joined(event):
    if event.user_id != borg.uid:
        return
    last_msg = storage.last_msg or 0
    await borg(SaveDraftRequest(peer=chat, message="", reply_to_msg_id=last_msg))