mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-20 08:25:50 +08:00
up
This commit is contained in:
@@ -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__":
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user