mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 09:34:05 +08:00
opt some
This commit is contained in:
parent
abf843548f
commit
8a6e6a7cde
@ -64,7 +64,7 @@ func Toast(m *ice.Message, text string, arg ...ice.Any) { // [title [duration [p
|
||||
}
|
||||
}
|
||||
}
|
||||
m.Go(func() { PushNoticeToast(m, text, arg) })
|
||||
PushNoticeToast(m, text, arg)
|
||||
}
|
||||
func Toast3s(m *ice.Message, text string, arg ...ice.Any) {
|
||||
Toast(m, text, kit.List(kit.Select("", arg, 0), kit.Select("3s", arg, 1))...)
|
||||
@ -73,7 +73,6 @@ func Toast30s(m *ice.Message, text string, arg ...ice.Any) {
|
||||
Toast(m, text, kit.List(kit.Select("", arg, 0), kit.Select("30s", arg, 1))...)
|
||||
}
|
||||
func GoToast(m *ice.Message, title string, cb func(toast func(string, int, int))) {
|
||||
m.Go(func() {
|
||||
cb(func(name string, count, total int) {
|
||||
Toast(m,
|
||||
kit.Format("%s %s/%s", name, strings.TrimSuffix(kit.FmtSize(int64(count)), "B"), strings.TrimSuffix(kit.FmtSize(int64(total)), "B")),
|
||||
@ -82,7 +81,6 @@ func GoToast(m *ice.Message, title string, cb func(toast func(string, int, int))
|
||||
count*100/total,
|
||||
)
|
||||
})
|
||||
})
|
||||
}
|
||||
func PushStream(m *ice.Message, cmds ...ice.Any) *ice.Message {
|
||||
m.Option(cli.CMD_OUTPUT, file.NewWriteCloser(func(buf []byte) (int, error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user