load last 10 messages on chat add

This commit is contained in:
2019-01-28 00:30:40 +03:00
parent b7e68abb03
commit fbfe72c774
3 changed files with 25 additions and 4 deletions

View File

@@ -15,7 +15,11 @@ Session.notice_displayed = True
def get_client():
config._reload_maybe()
session_path = os.path.relpath(default_storage.path(config.pyrogram_session.replace('.session', '')))
pyrogram_sesssion = config.pyrogram_session.replace('.session', '')
if not pyrogram_sesssion or not config.pyrogram_app_id or config.pyrogram_app_hash:
raise RuntimeError('Pyrogram is not configured')
session_path = os.path.relpath(default_storage.path(pyrogram_sesssion))
return Client(session_path, config.pyrogram_app_id, config.pyrogram_app_hash)