Skip to main content

Multi Sessions addon for Telethon

Installing:

pip3 install tlmulticlient

How to use:

# importing multiclient library and other required imports
from tlmulticlient import MultiClient
import asyncio
from telethon import events
# create the multiclient

client = MultiClient(api_id=12345, api_hash='my_api_hash', sessions=['list', 'of', 'str_sessions'])

# listenting to new messages

@client.on(events.NewMessage)
def listener(event):
    # Now we need to use `event.client.etc` instead of client.etc to be able to run a function on all the available clients!
    await event.client.send_message(event.chat_id, "Hello World!")

    # To find out from which session an event was triggered we use:
    id = event.client.session_id # session id is the name of the session attached to the client which received the event.
    if id == 'str_sessions':
        print('This event was triggered from the session named str_sessions')
    else:
        print('This event was triggered from the session named {0}'.format(id))

# iterate though all the clients

for c in client:
    print(c.session_id)

# run all the clients

loop = asyncio.get_event_loop()
client.run_all_clients(loop=loop)

Metadata

Release files for tlmulticlient 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for tlmulticlient 0.0.5
File Interpreter ABI Platform Actions
tlmulticlient-0.0.5-py2.py3-none-any.whl Python 2, Python 3 none any Details for tlmulticlient-0.0.5-py2.py3-none-any.whl

Release files / tlmulticlient-0.0.5-py2.py3-none-any.whl

Download URL tlmulticlient-0.0.5-py2.py3-none-any.whl
Size 3.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c640e842bf0bdf3282ea4cdf6f8ebcdb834906d7c3b69a1fbacdcc6d1d93d948
BLAKE2b-256 checksum
How to use checksums
45e0140e516a77aefb4ae820453384f50aa1440c7d952d085dfe2ad6075e81c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.9.0a2+

Security for tlmulticlient 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page