diff --git a/main.py b/main.py index 776f5dd..1023b62 100644 --- a/main.py +++ b/main.py @@ -7,7 +7,7 @@ from telethon.tl import types from tools.down_file import down_group -from tools.tool import print_all_channel +from tools.tool import print_all_channel,Hook config_path = './config.json' # 配置处理开始 @@ -59,6 +59,7 @@ async def client_main(): exit() with client.start(phone=phone, bot_token=bot_token): client.loop.run_until_complete(client_main()) + client.loop.run_until_complete(Hook(client)) plus_func = '>0' if len(sys.argv) == 1: select = input('功能选择:\n1、查看所有频道\n2、下载频道资源\n') diff --git a/tools/tool.py b/tools/tool.py index 66c4a70..78579db 100644 --- a/tools/tool.py +++ b/tools/tool.py @@ -1,3 +1,5 @@ +import time + from telethon import TelegramClient from telethon.tl import types @@ -40,3 +42,7 @@ async def getHistoryMessage(client: TelegramClient, chat_id: int, plus_func=None else: messages = client.iter_messages(chat_id, reverse=True) return channel_title, messages + + +async def Hook(client: TelegramClient): + pass