Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
anasty17
GitHub Repository: anasty17/mirror-leech-telegram-bot
Path: blob/master/bot/__main__.py
1627 views
1
from . import LOGGER, bot_loop
2
from .core.telegram_manager import TgClient
3
from .core.config_manager import Config
4
5
Config.load()
6
7
8
async def main():
9
from asyncio import gather
10
from .core.startup import (
11
load_settings,
12
load_configurations,
13
save_settings,
14
update_aria2_options,
15
update_nzb_options,
16
update_qb_options,
17
update_variables,
18
)
19
20
await load_settings()
21
22
await gather(TgClient.start_bot(), TgClient.start_user())
23
await gather(load_configurations(), update_variables())
24
25
from .core.torrent_manager import TorrentManager
26
27
await TorrentManager.initiate()
28
await gather(
29
update_qb_options(),
30
update_aria2_options(),
31
update_nzb_options(),
32
)
33
from .helper.ext_utils.files_utils import clean_all
34
from .core.jdownloader_booter import jdownloader
35
from .helper.ext_utils.telegraph_helper import telegraph
36
from .helper.mirror_leech_utils.rclone_utils.serve import rclone_serve_booter
37
from .modules import (
38
initiate_search_tools,
39
get_packages_version,
40
restart_notification,
41
)
42
43
await gather(
44
save_settings(),
45
jdownloader.boot(),
46
clean_all(),
47
initiate_search_tools(),
48
get_packages_version(),
49
restart_notification(),
50
telegraph.create_account(),
51
rclone_serve_booter(),
52
)
53
54
55
bot_loop.run_until_complete(main())
56
57
from .helper.ext_utils.bot_utils import create_help_buttons
58
from .helper.listeners.aria2_listener import add_aria2_callbacks
59
from .core.handlers import add_handlers
60
61
add_aria2_callbacks()
62
create_help_buttons()
63
add_handlers()
64
65
LOGGER.info("Bot Started!")
66
bot_loop.run_forever()
67
68