MCPcopy Create free account
hub / github.com/VJBots/VJ-File-Store / start

Function start

bot.py:64–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62
63
64async def start():
65 print('\n')
66 print('Initalizing Tech VJ Bot')
67 bot_info = await StreamBot.get_me()
68 StreamBot.username = bot_info.username
69 await initialize_clients()
70 for name in files:
71 with open(name) as a:
72 patt = Path(a.name)
73 plugin_name = patt.stem.replace(".py", "")
74 plugins_dir = Path(f"plugins/{plugin_name}.py")
75 import_path = "plugins.{}".format(plugin_name)
76 spec = importlib.util.spec_from_file_location(import_path, plugins_dir)
77 load = importlib.util.module_from_spec(spec)
78 spec.loader.exec_module(load)
79 sys.modules["plugins." + plugin_name] = load
80 print("Tech VJ Imported => " + plugin_name)
81 if ON_HEROKU:
82 asyncio.create_task(ping_server())
83 me = await StreamBot.get_me()
84 tz = pytz.timezone('Asia/Kolkata')
85 today = date.today()
86 now = datetime.now(tz)
87 time = now.strftime("%H:%M:%S %p")
88 app = web.AppRunner(await web_server())
89 await StreamBot.send_message(chat_id=LOG_CHANNEL, text=script.RESTART_TXT.format(today, time))
90 await app.setup()
91 bind_address = "0.0.0.0"
92 await web.TCPSite(app, bind_address, PORT).start()
93 if CLONE_MODE == True:
94 await restart_bots()
95 print("Bot Started Powered By @VJ_Bots")
96 await idle()
97
98# Don't Remove Credit Tg - @VJ_Bots
99# Subscribe YouTube Channel For Amazing Bot https://youtube.com/@Tech_VJ

Callers 1

bot.pyFile · 0.70

Calls 4

initialize_clientsFunction · 0.90
ping_serverFunction · 0.90
web_serverFunction · 0.90
restart_botsFunction · 0.90

Tested by

no test coverage detected