mirror of
https://shylinux.com/x/icebergs
synced 2025-04-27 01:48:27 +08:00
opt some
This commit is contained in:
parent
24bc1861ab
commit
5f3c3e4b36
@ -76,6 +76,9 @@ func Toast30s(m *ice.Message, text string, arg ...ice.Any) {
|
|||||||
}
|
}
|
||||||
func GoToast(m *ice.Message, title string, cb func(toast func(string, int, int))) {
|
func GoToast(m *ice.Message, title string, cb func(toast func(string, int, int))) {
|
||||||
cb(func(name string, count, total int) {
|
cb(func(name string, count, total int) {
|
||||||
|
if total == 0 {
|
||||||
|
total = 1
|
||||||
|
}
|
||||||
Toast(m,
|
Toast(m,
|
||||||
kit.Format("%s %s/%s", name, strings.TrimSuffix(kit.FmtSize(int64(count)), "B"), strings.TrimSuffix(kit.FmtSize(int64(total)), "B")),
|
kit.Format("%s %s/%s", name, strings.TrimSuffix(kit.FmtSize(int64(count)), "B"), strings.TrimSuffix(kit.FmtSize(int64(total)), "B")),
|
||||||
kit.Format("%s %d%%", title, count*100/total),
|
kit.Format("%s %d%%", title, count*100/total),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user