Pyromongo
Persistent Session Storage for Pyrogram (MongoDB) | It works
Install / Use
/learn @animeshxd/PyromongoREADME
pyromongo
INTRODUCTION
Persistent Session Storage for Pyrogram and its forks with MongoDB
from pyrogram.client import Client
from pyromongo import MongoStorage
from motor.motor_asyncio import AsyncIOMotorClient
client = Client(..)
mongo = AsyncIOMotorClient("mongodb+srv://..")
client.storage = MongoStorage(mongo["pyrogram"], remove_peers=False) # use remove_peers=True to remove all peers on logout
client.run()
Custom Collection Names
# Use custom collection names for peers and session data
client.storage = MongoStorage(
mongo["pyrogram"],
remove_peers=False,
peers_collection_name="my_peers",
session_collection_name="my_session"
)
Note:
❌ It will not work with the pyrogram context manager.
async def main():
async with Client(..) as client:
client.storage = MongoStorage(..)
# It will only store peers
INSTALLATION:
pip install pyromongo
# Install from git
pip install git+https://github.com/animeshxd/pyromongo
Install dnspython for mongo+srv://.. URIs
pip install dnspython
# or pip install -U pyromongo[srv]
# for Termux use dnspython fork
apt install resolv-conf
pip install git+https://github.com/animeshxd/dnspython
Install with all extra dependencies
pip install "pyromongo[gssapi,aws,ocsp,snappy,srv,zstd,encryption]"
Check other required dependencies for motor https://motor.readthedocs.io/en/stable/installation.html#dependencies
Related Skills
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
