https://github.com/ezdev128/telethon-session-redis
Redis backend for Telethon session storage
https://github.com/ezdev128/telethon-session-redis
redis sessions telethon
Last synced: 6 months ago
JSON representation
Redis backend for Telethon session storage
- Host: GitHub
- URL: https://github.com/ezdev128/telethon-session-redis
- Owner: ezdev128
- License: mit
- Created: 2018-03-14T13:00:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-16T12:26:12.000Z (over 8 years ago)
- Last Synced: 2025-11-10T09:16:12.202Z (9 months ago)
- Topics: redis, sessions, telethon
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 22
- Watchers: 2
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Telethon Redis session
===========================
A `Telethon`_ session storage implementation backed by Redis.
.. _Telethon: https://github.com/LonamiWebs/Telethon
Usage
-----
This session implementation can store multiple Sessions in the same key hive.
Installing
----------
.. code-block:: sh
pip3 install teleredis
Upgrading
----------
.. code-block:: sh
pip3 install -U teleredis
Quick start
-----------
.. code-block:: python
from telethon import TelegramClient
from teleredis import RedisSession
import redis
# These example values won't work. You must get your own api_id and
# api_hash from https://my.telegram.org, under API Development.
api_id = 12345
api_hash = '0123456789abcdef0123456789abcdef'
redis_connector = redis.Redis(host='localhost', port=6379, db=0, decode_responses=False)
session = RedisSession('session_name', redis_connector)
client = TelegramClient(session, api_id, api_hash)
client.start()