-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
34 lines (24 loc) · 902 Bytes
/
main.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
import telegram, logging, threading, datetime, argparse, sys
from telegram.ext import Updater, MessageHandler, CommandHandler, Filters
from modules.pytg.init import boot, initialize, launch
def __main():
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO,
# filename="pytg-bot.log"
)
logging.info(" ### Launching Bot... ### ")
logging.info(str(datetime.datetime.now()))
parser = argparse.ArgumentParser(description='PyTG command line launcher')
parser.add_argument("--main-module")
parser.add_argument("--devmode", action="store_true")
args = parser.parse_args()
main_module = args.main_module
dev_mode = args.devmode
if not main_module:
main_module = "bot"
boot(dev_mode)
initialize()
launch(main_module)
if __name__ == '__main__':
__main()