forked from m4mallu/clonebot-cmd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample_config.py
37 lines (29 loc) · 1 KB
/
sample_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
#----------------------------------- https://github.com/m4mallu/clonebot --------------------------------------------#
import os
import logging
from logging.handlers import RotatingFileHandler
logging.basicConfig(
level=logging.INFO,
format="[%(asctime)s - %(levelname)s] - %(name)s - %(message)s",
datefmt='%d-%b-%y %H:%M:%S',
handlers=[
RotatingFileHandler(
"clonebot.txt",
maxBytes=50000000,
backupCount=10
),
logging.StreamHandler()
]
)
logging.getLogger("pyrogram").setLevel(logging.WARNING)
class Config(object):
# Get a bot token from botfather
TG_BOT_TOKEN = os.environ.get("TG_BOT_TOKEN", "")
# Get from my.telegram.org
APP_ID = int(os.environ.get("APP_ID", ""))
# Get from my.telegram.org
API_HASH = os.environ.get("API_HASH", "")
# Generate a user session string
TG_USER_SESSION = os.environ.get("TG_USER_SESSION", "")
def LOGGER(name: str) -> logging.Logger:
return logging.getLogger(name)