MCPcopy Create free account
hub / github.com/FloatTech/ZeroBot-Plugin / botruntime

Function botruntime

plugin/aifalse/main.go:546–561  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

544}
545
546func botruntime() (string, error) {
547 hostinfo, err := host.Info()
548 if err != nil {
549 return "", err
550 }
551 t := &strings.Builder{}
552 t.WriteString("ZeroBot-Plugin 已运行 ")
553 t.WriteString(strconv.FormatInt((time.Now().Unix()-boottime.Unix())/86400, 10))
554 t.WriteString(" 天 ")
555 t.WriteString(time.Unix(time.Now().Unix()-boottime.Unix(), 0).UTC().Format("15:04:05"))
556 t.WriteString(" | 系统运行 ")
557 t.WriteString(strconv.FormatInt(int64(hostinfo.Uptime)/86400, 10))
558 t.WriteString(" 天 ")
559 t.WriteString(time.Unix(int64(hostinfo.Uptime), 0).UTC().Format("15:04:05"))
560 return t.String(), nil
561}
562
563func botstatus() (string, error) {
564 hostinfo, err := host.Info()

Callers 1

drawstatusFunction · 0.85

Calls 2

FormatMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected