watzon / telethon-session-mongo

MongoDB backend for Telethon session storage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Telethon MongoDB Session

This is a Telethon session backend which uses MongoDB.

Installing

pip3 install telemongo

# or, with poetry

poetry add telemongo

Upgrading

pip3 install -U telemongo mongoengine

# or, with poetry

poetry add -U telemongo mongoengine

Usage

from telemongo import MongoSession
from telethon import TelegramClient

api_id = 12345
api_hash = "0123456789abcdef0123456789abcdef"
host = "mongo://username:pass@mongo_host/dbname"

session = MongoSession(host=host)

client = TelegramClient(session, api_id, api_hash)
client.start()

About

MongoDB backend for Telethon session storage

License:MIT License


Languages

Language:Python 100.0%