add more pyrogram settings

This commit is contained in:
bakatrouble 2019-01-30 20:11:31 +03:00
parent 459de8c00c
commit f8ad07259c
2 changed files with 5 additions and 1 deletions

View File

@ -20,7 +20,8 @@ def get_client(takeout=False):
session_path = os.path.relpath(default_storage.path(config.pyrogram_session.replace('.session', ''))) 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, takeout=takeout) return Client(session_path, config.pyrogram_app_id, config.pyrogram_app_hash, config.pyrogram_app_version or None,
config.pyrogram_device_model or None, config.pyrogram_system_version or None, takeout=takeout)
def save_message(client, message: PyrogramMessage): def save_message(client, message: PyrogramMessage):

View File

@ -43,6 +43,9 @@ class AggregatorAppConfigForm(ConfigForm):
pyrogram_app_id = forms.CharField() pyrogram_app_id = forms.CharField()
pyrogram_app_hash = forms.CharField() pyrogram_app_hash = forms.CharField()
pyrogram_app_version = forms.CharField(required=False)
pyrogram_device_model = forms.CharField(required=False)
pyrogram_system_version = forms.CharField(required=False)
pyrogram_session = forms.FileField() pyrogram_session = forms.FileField()
def save_session(self): def save_session(self):