8000 GitHub - William3Johnson/client-1: Easy-to-use asynchronous TDLib wrapper for Telegram bots.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

William3Johnson/client-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pytdbot version downloads

Easy, Sample and powerful TDLib-based client for Telegram bots.

Requirements

Installation

pip install pytdbot

From github

pip install git+https://github.com/pytdbot/client.git

Examples

Basic example:

from pytdbot import Client
from pytdbot.types import Update

client = Client(
    api_id=0,  
    api_hash="API_HASH",  
    database_encryption_key="1234echobot$",
    token="1088394097:AAQX2DnWiw4ihwiJUhIHOGog8gGOI",  # Your bot token. You can get it from https://t.me/botfather
    files_directory="BotDB",  # path where to store session and files.
    lib_path="/path/to/libtdjson.so" # Path to TDjson shared library.
)


@client.on_updateNewMessage()
async def print_message(c: Client, message: Update):
    print(message)


@client.on_updateNewMessage()
async def simple_message(c: Client, message: Update):
    await message.reply_text('Hi! i am simple bot')


# Run the client
client.run()

For more examples, check the examples folder.

Contributing

Pull requests are always welcome!!

License

MIT License

About

Easy-to-use asynchronous TDLib wrapper for Telegram bots.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%
0