fix: remove main.py request module
This commit is contained in:
7
main.py
7
main.py
@@ -2,9 +2,7 @@ import threading
|
|||||||
import time
|
import time
|
||||||
import asyncio
|
import asyncio
|
||||||
import os, sys
|
import os, sys
|
||||||
import signal
|
import json
|
||||||
import requests,json
|
|
||||||
|
|
||||||
|
|
||||||
abs_path = os.path.dirname(os.path.realpath(sys.argv[0])) + '/'
|
abs_path = os.path.dirname(os.path.realpath(sys.argv[0])) + '/'
|
||||||
|
|
||||||
@@ -52,6 +50,7 @@ def hot_update():
|
|||||||
if not os.path.exists(target):
|
if not os.path.exists(target):
|
||||||
version = 0
|
version = 0
|
||||||
try:
|
try:
|
||||||
|
import requests
|
||||||
res = requests.get("https://soulter.top/channelbot/update.json")
|
res = requests.get("https://soulter.top/channelbot/update.json")
|
||||||
res_obj = json.loads(res.text)
|
res_obj = json.loads(res.text)
|
||||||
ol_version = float(res_obj['version'])
|
ol_version = float(res_obj['version'])
|
||||||
@@ -176,11 +175,11 @@ if __name__ == "__main__":
|
|||||||
pid = os.getpid()
|
pid = os.getpid()
|
||||||
global ma_type
|
global ma_type
|
||||||
print("程序PID:"+str(pid))
|
print("程序PID:"+str(pid))
|
||||||
|
print
|
||||||
check_env()
|
check_env()
|
||||||
bot_event = threading.Event()
|
bot_event = threading.Event()
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
# ma_type = get_platform()
|
# ma_type = get_platform()
|
||||||
# if ma_type == 'linux':
|
# if ma_type == 'linux':
|
||||||
# threading.Thread(target=hot_update).start()
|
# threading.Thread(target=hot_update).start()
|
||||||
|
|
||||||
main(loop, bot_event)
|
main(loop, bot_event)
|
||||||
Reference in New Issue
Block a user