Skip to content

Commit

Permalink
增加Hook函数,提供自定义插件功能
Browse files Browse the repository at this point in the history
  • Loading branch information
holll committed Apr 6, 2023
1 parent afb1567 commit 4317f5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
# 配置处理开始
Expand Down Expand Up @@ -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')
Expand Down
6 changes: 6 additions & 0 deletions tools/tool.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import time

from telethon import TelegramClient
from telethon.tl import types

Expand Down Expand Up @@ -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

0 comments on commit 4317f5d

Please sign in to comment.