This commit is contained in:
midoks
2023-04-28 17:21:13 +08:00
parent ed6df6d527
commit 35424eae1f
2 changed files with 11 additions and 14 deletions
@@ -6,6 +6,7 @@ import re
import json
import base64
import threading
import asyncio
sys.path.append(os.getcwd() + "/class/core")
import mw
@@ -15,9 +16,11 @@ from telebot import types
from telebot.util import quick_markup
def run(client):
print(client)
return ''
async def run(client):
while True:
print("123123" + str(time.time()))
await asyncio.sleep(1)
# print(client)
if __name__ == "__main__":
+5 -11
View File
@@ -96,22 +96,16 @@ while True:
client = TelegramClient('mdioks', cfg['bot']['api_id'], cfg['bot']['api_hash'])
async def change_name_auto():
while True:
print('will change name')
await asyncio.sleep(1)
async def plugins_run():
init_list = getStartExtCfgByTag('client')
for p in init_list:
plist = getStartExtCfgByTag('client')
for p in plist:
try:
script = p['name'].split('.')[0]
__import__(script).init(client)
await __import__(script).run(client)
except Exception as e:
writeLog('-----init error start -------')
writeLog('-----client error start -------')
writeLog(mw.getTracebackInfo())
writeLog('-----init error end -------')
writeLog('-----client error end -------')
async def main(loop):
await client.start()