-
Notifications
You must be signed in to change notification settings - Fork 1
/
constants.py
42 lines (30 loc) · 1.26 KB
/
constants.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
from environs import Env
CHAT_ID_IMESEC_CORE = -1001284501077
CHAT_ID_RAZGRIZONE = 131845033
CHAT_ID_R0ZBOT = 211525815
ADA_URL = 'https://ada.imesec.ime.usp.br/_healthcheck'
STICKER_ID_KK_MORRI = 'CAACAgEAAxkBAAEBUeVfWvNObQABfZeZEcdQIsqX62ZYMkYAAgUAA7egmwxPKqv9NDFYYxsE'
env = Env()
env.read_env()
TELEGRAM_API_TOKEN = env('TELEGRAM_API_TOKEN')
GITHUB_SECRET = env('GITHUB_SECRET')
# Dict of conversations IDs followed by regex to match agains repository names
default_conversations = {
CHAT_ID_RAZGRIZONE: '.*',
CHAT_ID_IMESEC_CORE: '.*',
CHAT_ID_R0ZBOT: '.*'
}
def __conversation_subcast(s: str):
try:
return int(s)
except:
return s
CONVERSATIONS = env.dict('CONVERSATIONS', default_conversations, subcast=__conversation_subcast)
HEALTHCHECK_SERVICES = {'lightning-hacks Website': 'https://lh.imesec.ime.usp.br',
'lightning-hacks API': 'https://api.lh.imesec.ime.usp.br/hacks',
'lightning-hacks Timer': 'https://timer.imesec.ime.usp.br',
'IMEsec wiki': 'https://wiki.imesec.ime.usp.br',
'IMEsec Website': 'https://imesec.ime.usp.br'
}
HEALTHCHECK_SLEEP_AMOUNT = 2 * 60
HEALTHCHECK_ANOMALY_THRESHOLD = 3