[nonebot-plugin]状态提供更多品牌的cpu支持

This commit is contained in:
2024-08-23 23:47:01 +08:00
parent a7d0560932
commit 2eb5aae23f
9 changed files with 89 additions and 6 deletions

View File

@ -225,10 +225,20 @@ async def get_hardware_data() -> dict:
pass
swap = psutil.swap_memory()
cpu_brand_raw = cpuinfo.get_cpu_info().get("brand_raw", "Unknown")
if "AMD" in cpu_brand_raw:
if "amd" in cpu_brand_raw.lower():
brand = "AMD"
elif "Intel" in cpu_brand_raw:
elif "intel" in cpu_brand_raw.lower():
brand = "Intel"
elif "apple" in cpu_brand_raw.lower():
brand = "Apple"
elif "qualcomm" in cpu_brand_raw.lower():
brand = "Qualcomm"
elif "mediatek" in cpu_brand_raw.lower():
brand = "MediaTek"
elif "samsung" in cpu_brand_raw.lower():
brand = "Samsung"
elif "nvidia" in cpu_brand_raw.lower():
brand = "NVIDIA"
else:
brand = "Unknown"
result = {

View File

@ -31,6 +31,7 @@ async def _(bot: Bot, event: MessageEvent):
raw_message=event.raw_message,
data=event.dict(),
bot_id=bot.self_id,
user_id=str(event.user_id),
session_id=str(event.user_id if event.message_type == "private" else event.group_id),
session_type=event.message_type,
receive_channel="event_to_nonebot"