mirror of
https://github.com/TeamPGM/PagerMaid_Plugins_Pyro.git
synced 2024-11-16 08:19:25 +00:00
speed_test 修复问题
This commit is contained in:
parent
1a13ed75d5
commit
cf783ebce5
@ -342,7 +342,7 @@
|
||||
},
|
||||
{
|
||||
"name": "speed_test",
|
||||
"version": "1.002",
|
||||
"version": "1.003",
|
||||
"section": "chat",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "3.02 kb",
|
||||
|
@ -34,10 +34,13 @@ def unit_convert(byte):
|
||||
|
||||
async def run_speedtest(message: Message):
|
||||
test = Speedtest()
|
||||
server = [int(message.arguments)] if len(message.parameter) == 1 else []
|
||||
server = int(message.arguments) if len(message.parameter) == 1 else None
|
||||
if server:
|
||||
test.get_servers(servers=server)
|
||||
else:
|
||||
servers = test.get_closest_servers()
|
||||
for i in servers:
|
||||
if i["id"] == str(server):
|
||||
test.servers = i
|
||||
break
|
||||
test.get_best_server(servers=test.servers)
|
||||
test.download()
|
||||
test.upload()
|
||||
|
Loading…
Reference in New Issue
Block a user