|
|
|
@ -13,14 +13,14 @@ from aggregator.models import AggregationSource, Message, Chat
|
|
|
|
|
Session.notice_displayed = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_client():
|
|
|
|
|
def get_client(takeout=False):
|
|
|
|
|
config._reload_maybe()
|
|
|
|
|
if not config.pyrogram_session or not config.pyrogram_app_id or not config.pyrogram_app_hash:
|
|
|
|
|
raise RuntimeError('Pyrogram is not configured')
|
|
|
|
|
|
|
|
|
|
session_path = os.path.relpath(default_storage.path(config.pyrogram_session.replace('.session', '')))
|
|
|
|
|
|
|
|
|
|
return Client(session_path, config.pyrogram_app_id, config.pyrogram_app_hash)
|
|
|
|
|
return Client(session_path, config.pyrogram_app_id, config.pyrogram_app_hash, takeout=takeout)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def save_message(client, message: PyrogramMessage):
|
|
|
|
|