GithubHelp home page GithubHelp logo

pyleaves's Introduction

PyLeaves

🌿 telegram bot's python pypi package & tools for pyrogram

⚠️ Must install

These requirements must be installed in your repo

  • pyrogram
  • tgcrypto

Current featur ⚡️

progress_for_pyrogram():

This is async function of ( Download | Upload ) progress bar with simple way to use

Example

# import time.time and other 
from pyleaves import Leaves # must import 

PROGRESS_BAR = """
percentage: {percentage} | {current}
total completed: {total}%
current speed: {speed}/s
estimate time: {est_time} """

Button = InlineKeyboardMarkup([[InlineKeyboardButton('text', callback_data="data")]])

start_time = time()
editable_text = await app.send_message(chat_id, "download started")

# download media 
await app.download_media(
    message,
    progress=Leaves.progress_for_pyrogram,
    progress_args=(
        "try to download......", # 1. must be a string 
        editable_text, # 2. editable message 
        start_time # 3. time.time() import time.time  & time()
        PROGRESS_BAR, # 4. progress template check more description 
        '▣', # 5. string character for identifie the finished percentage 
        '▢', # 6. string character for identifie the unfinished percentage
        Button, # 7. pyrogram replay_markup 
        )
    )       

# ⚠️ don't use  parameters keyword & must keep this Oder 

formats of template

  • {current} = process completed file size
  • {total} = total file size
  • {percentage} = total completed percentage
  • {speed} = current speed in byte/second
  • {est_time} = estimated time

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.