-
Notifications
You must be signed in to change notification settings - Fork 3
/
configs.py
36 lines (28 loc) · 1.08 KB
/
configs.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
# Debug
DEBUG = os.environ.get('DEBUG', False)
# Your bot token
TELEGRAM_BOT_TOKEN = os.environ.get('TELEGRAM_BOT_TOKEN')
# Bot administrator username, example: @Jone
ADMINISTRATOR_USERNAME = os.environ.get('ADMINISTRATOR_USERNAME')
# Database url
# SQLite, Postgresql, MySQL, Oracle, MS-SQL, Firebird, Sybase...
# More info: https://docs.sqlalchemy.org/en/13/dialects/
DATABASE_URI = os.environ.get('DATABASE_URL')
if DATABASE_URI and DATABASE_URI.startswith("postgres://"):
DATABASE_URI = DATABASE_URI.replace("postgres://", "postgresql://", 1)
# Webhook
# Enable webhook mode.
# Default is false.
# If you use webhook you must set the WEBHOOK_PORT and WEBHOOK_URL
# About webhook: https://github.com/python-telegram-bot/python-telegram-bot/wiki/Webhooks
WEBHOOK_MODE = os.environ.get('WEBHOOK_MODE', False)
# Listen address
WEBHOOK_LISTEN = os.environ.get('WEBHOOK_LISTEN', '127.0.0.1')
# Webhook port
# Default is 5000.
WEBHOOK_PORT = os.environ.get('WEBHOOK_PORT', 5000)
# Webhook port
WEBHOOK_URL = os.environ.get('WEBHOOK_URL')