forked from 39bit/spoilerobot
-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.py
40 lines (30 loc) · 1.15 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
import os
# the telegram bot token
BOT_TOKEN = os.environ['token']
# the user_id of the administrator
ADMIN_ID = int(os.environ['admin_id'])
# Extra text to insert at the end of /help
CONTACT_TEXT = os.environ.get('contact_text', '')
# postgresql database configs
DB_NAME = 'spoilerobot'
DB_USERNAME = 'spoilerobot'
DB_HOST = 'localhost'
DB_PASSWORD = os.environ['db_pwd']
# pepper is used to season the hash of the uuid so that it's harder to brute force a uuid
if 'pepper' not in os.environ:
print('Please add pepper={} to your environmental variables'.format(
os.urandom(8).hex()
))
exit(1)
HASH_PEPPER = os.environ['pepper']
# the time in seconds in between timestamps of the request count statistic
REQUEST_COUNT_RESOLUTION = 600
# how many seconds before old taps are ignored
MULTIPLE_CLICK_TIMEOUT = 20
# how long in seconds to cache minor spoilers on the client-side
MINOR_SPOILER_CACHE_TIME = 3600
# The maximum length (in bytes) for a inline query before an advanced spoilers has to be used
# (this is a telegram limitation)
MAX_INLINE_LENGTH = 256
# Max length of a spoiler's description when created in PM
MAX_DESCRIPTION_LENGTH = 1024