update shops display

This commit is contained in:
shoopea 2020-02-14 11:32:28 +08:00
parent 4c73649438
commit b1689e7c15

10
job.go
View File

@ -2269,23 +2269,23 @@ func jobShops(j Job) {
} }
} }
out = fmt.Sprintf("%s [%4d💧]", out, cwm.Mana) out = fmt.Sprintf("%s [%4d💧]", out, cwm.Mana)
out = fmt.Sprintf("%s <a href=\"https://t.me/share/url?url=/ws_%s\">%s</a> ", out, cwm.Link, cwm.User) out = fmt.Sprintf("%s <a href=\"https://t.me/share/url?url=/ws_%s\">%s</a>", out, cwm.Link, cwm.User)
if cwm.Mana < cwm.ManaTotal { if cwm.Mana < cwm.ManaTotal {
out = fmt.Sprintf("%s ", out)
t := (cwm.ManaTotal - cwm.Mana) / ((cwm.ManaTotal / 250) + 1) t := (cwm.ManaTotal - cwm.Mana) / ((cwm.ManaTotal / 250) + 1)
d := time.Duration(t) * time.Minute d := time.Duration(t) * time.Minute
if d.Hours() > 1 { if d.Hours() > 1 {
out = fmt.Sprintf("%s%.0fh\n", out, d.Hours()) out = fmt.Sprintf("%s%.0fh", out, d.Hours())
} }
d = d - d.Truncate(1*time.Hour) d = d - d.Truncate(1*time.Hour)
if d.Minutes() > 0 { if d.Minutes() > 0 {
out = fmt.Sprintf("%s%.0fm\n", out, d.Minutes()) out = fmt.Sprintf("%s%.0fm", out, d.Minutes())
}
} }
} else {
out = fmt.Sprintf("%s\n", out) out = fmt.Sprintf("%s\n", out)
} }
} }
}
for _, m := range p.Msgs { for _, m := range p.Msgs {
clientDelTGMsg(m.TGUserID64, m.ID64, m.ChatID64) clientDelTGMsg(m.TGUserID64, m.ID64, m.ChatID64)