This repository has been archived by the owner on Aug 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
config.py
37 lines (29 loc) · 1.16 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
#!/usr/bin/python3
# -*- coding: utf-8 -*
"""
Configuration file.
"""
import logging
import argparse
# Set cli arguments
OPTIONS = argparse.ArgumentParser(prog='run.py',
description='A Telegram Bot who answers to all of your questions')
OPTIONS.add_argument('--TELEGRAM_TOKEN', help='Insert Telegram Token', required=True)
OPTIONS.add_argument('--ADMIN_CHAT_ID', help='Insert Telegram ChatID', nargs="*", default=[])
OPTIONS.add_argument('--DIALOGFLOW_KEY', help='Specify Dialogflow Key Path', required=True)
OPTIONS.add_argument('--WIT_TOKEN', help='Specify Wit Token', default='')
OPTIONS.add_argument('--LANG', help='Specify language cod', default='en')
OPTIONS.add_argument('--log', help='Set logging value', default='DEBUG')
ARGUMENTS = OPTIONS.parse_args()
# Logging configs
logging.basicConfig(format='%(asctime)s - %(levelname)s: %(message)s.',
level=ARGUMENTS.log)
# Telegram configs
TELEGRAM_TOKEN = ARGUMENTS.TELEGRAM_TOKEN
ADMIN_CHAT_ID = ARGUMENTS.ADMIN_CHAT_ID
# Dialogflow configs
DIALOGFLOW_KEY = ARGUMENTS.DIALOGFLOW_KEY
# WIT configs
WIT_TOKEN = ARGUMENTS.WIT_TOKEN
# Language configs
LANG = ARGUMENTS.LANG