forked from kirodewal/TgIndexPro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
75 lines (63 loc) · 2.04 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# -*- coding: utf-8 -*-
# (c) @Kirodewal
import traceback
import json
import sys
import os
try:
port = int(os.environ.get("PORT", "8080"))
except ValueError:
port = -1
if not 1 <= port <= 65535:
print("Please make sure the PORT environment variable is an integer between 1 and 65535")
sys.exit(1)
try:
api_id = int(os.environ["API_ID"])
api_hash = os.environ["API_HASH"]
except (KeyError, ValueError):
traceback.print_exc()
print("\n\nPlease set the API_ID and API_HASH environment variables correctly. If you don't know how to do contact @kirodewal on telegram")
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)
# don't change anything here only put your chat ids in 'include_chats'.
index_settings = {
"index_all": False,
"index_private":True,
"index_group": True,
"index_channel": True,
"exclude_chats": [],
"include_chats": [-1001268815373,-1001128149001,],#my index chat
}
otg_settings = {
"otg": {
"enable": True,
"include_private": True,
"include_group": True,
"include_channel": True
}
}
otg_settings = "otg"
enable_otg = "enable"
except:
traceback.print_exc()
print("\n\nPlease set the INDEX_SETTINGS environment variable correctly")
sys.exit(1)
try:
session_string = os.environ["SESSION_STRING"] # use @StringSessionGen_Bot to get this value.
except (KeyError, ValueError):
traceback.print_exc()
print("\n\nPlease set the SESSION_STRING environment variable correctly")
sys.exit(1)
# try:
# bot_token = os.environ["BOT_TOKEN"]
# except (KeyError, ValueError):
# traceback.print_exc()
# print("\n\nPlease set the BOT_TOKEN environment variable correctly")
# sys.exit(1)
host = os.environ.get("HOST", "0.0.0.0")
debug = bool(os.environ.get("DEBUG"))
chat_ids = [] # don't change.
alias_ids = [] # don't change.