Skip to main content

MongoDB backend for Telethon session storage

Project description

Telethon MongoDB Session

This is a Telethon session backend which uses MongoDB.

Installing

pip3 install telemongo

Upgrading

pip3 install -U telemongo mongoengine

Usage

from mongoengine import connect
from telemongo import MongoSession
from telethon import TelegramClient

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

connect('dbname', host=host)
session = MongoSession('dbname', host=host)

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telemongo-0.2.2.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

telemongo-0.2.2-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page