add otg indexing support

This commit is contained in:
odysseusmax
2020-09-20 22:08:52 +05:30
parent fe194ca9e8
commit 2fffd9353d
8 changed files with 219 additions and 128 deletions

View File

@ -20,14 +20,12 @@ except (KeyError, ValueError):
print("\n\nPlease set the API_ID and API_HASH environment variables correctly")
print("You can get your own API keys at https://my.telegram.org/apps")
sys.exit(1)
try:
index_settings_str = os.environ["INDEX_SETTINGS"].strip()
index_settings = json.loads(index_settings_str)
'''
{"index_all": true, "index_private":false, "index_group": false, "index_channel": true, "include_chats": [], "exclude_chats": []}
'''
otg_settings = index_settings['otg']
enable_otg = otg_settings['enable']
except:
traceback.print_exc()
print("\n\nPlease set the INDEX_SETTINGS environment variable correctly")