Browse Source

删除消息中的换行,目前不知道为什么不支持换行

JamZYM 7 months ago
parent
commit
2fe17ef3c0
1 changed files with 4 additions and 2 deletions
  1. 4 2
      function/slash.go

+ 4 - 2
function/slash.go

@@ -51,11 +51,13 @@ func Func_serverStatus(connBot api.WsBot, user_id int) {
 	_disk, _ := disk.Usage("/")
 	// _net, _ := net.IOCounters(true)
 
-	response_text := fmt.Sprintf("内存: %v%%,\nCPU:%v%%,\n磁盘:%v%%", fmt.Sprintf("%.1f", _mem.UsedPercent), fmt.Sprintf("%.1f", _cpu[0]), fmt.Sprintf("%.1f", _disk.UsedPercent))
-	print(response_text)
+	// response_text := fmt.Sprintf("内存: %v%%,\nCPU:%v%%,\n磁盘:%v%%", fmt.Sprintf("%.1f", _mem.UsedPercent), fmt.Sprintf("%.1f", _cpu[0]), fmt.Sprintf("%.1f", _disk.UsedPercent))
+	response_text := fmt.Sprintf("内存: %v%%,CPU:%v%%,磁盘:%v%%", fmt.Sprintf("%.1f", _mem.UsedPercent), fmt.Sprintf("%.1f", _cpu[0]), fmt.Sprintf("%.1f", _disk.UsedPercent))
+	println(response_text)
 	if err != nil {
 		connBot.Send_private_msg(user_id, "服务器异常")
 	} else {
+		connBot.Send_private_msg(user_id, "服务器状态:")
 		connBot.Send_private_msg(user_id, response_text)
 	}
 }