mirror of
http://shenjack.top:5100/shenjack/icalingua-python-bot.git
synced 2024-11-23 12:41:05 +08:00
修改一下/bmcl的细节,步进版本号
This commit is contained in:
parent
492800fed6
commit
1da32a4401
2
main.py
2
main.py
|
@ -6,7 +6,7 @@ from lib_not_dr.loggers import config
|
||||||
|
|
||||||
from data_struct import get_config, BotConfig, BotStatus
|
from data_struct import get_config, BotConfig, BotStatus
|
||||||
|
|
||||||
_version_ = "0.3.1"
|
_version_ = "0.3.2"
|
||||||
|
|
||||||
logger = config.get_logger("bot")
|
logger = config.get_logger("bot")
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
import time
|
|
||||||
import json
|
import json
|
||||||
import asyncio
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import socketio
|
|
||||||
|
|
||||||
from lib_not_dr.loggers import config
|
from lib_not_dr.loggers import config
|
||||||
|
|
||||||
|
@ -10,11 +7,10 @@ from data_struct import NewMessage, SendMessage
|
||||||
|
|
||||||
logger = config.get_logger("bmcl")
|
logger = config.get_logger("bmcl")
|
||||||
|
|
||||||
|
_version_ = "1.0.0"
|
||||||
|
|
||||||
|
|
||||||
async def bmcl(sio, reply_msg: SendMessage, msg: NewMessage):
|
async def bmcl(sio, reply_msg: SendMessage, msg: NewMessage):
|
||||||
await asyncio.sleep(0.1)
|
|
||||||
await sio.emit(
|
|
||||||
"sendMessage", reply_msg.to_content("请求数据中……").to_json()
|
|
||||||
)
|
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session:
|
||||||
async with session.get(
|
async with session.get(
|
||||||
"https://bd.bangbang93.com/openbmclapi/metric/dashboard"
|
"https://bd.bangbang93.com/openbmclapi/metric/dashboard"
|
||||||
|
@ -51,10 +47,10 @@ async def bmcl(sio, reply_msg: SendMessage, msg: NewMessage):
|
||||||
data_bytes /= 1024
|
data_bytes /= 1024
|
||||||
|
|
||||||
report_msg = (
|
report_msg = (
|
||||||
"OpenBMCLAPI 状态:\n"
|
f"OpenBMCLAPI 状态面板v{_version_} :\n"
|
||||||
f"在线节点: {online_node} 带宽: {online_bandwidth}Mbps\n"
|
f"在线节点: {online_node} 带宽: {online_bandwidth}Mbps\n"
|
||||||
f"实时负载带宽: {data_bandwidth:.5f}Mbps 负载: {load_str:.3f}%\n"
|
f"实时负载: {load_str:.3f}% 带宽: {data_bandwidth:.5f}Mbps\n"
|
||||||
f"当日 总请求: {data_hits} 总数据量: {data_len}"
|
f"当日请求: {data_hits} 总数据量: {data_len}"
|
||||||
)
|
)
|
||||||
await sio.emit(
|
await sio.emit(
|
||||||
"sendMessage",
|
"sendMessage",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user