1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-27 17:58:29 +08:00
icebergs/core/chat/icons.go
2023-09-18 22:07:42 +08:00

27 lines
642 B
Go

package chat
import (
"strings"
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/lex"
kit "shylinux.com/x/toolkits"
)
func init() {
const ICONS = "icons"
Index.MergeCommands(ice.Commands{
ICONS: {Hand: func(m *ice.Message, arg ...string) {
m.Option(lex.SPLIT_SPACE, " {:;}")
m.Cmd(lex.SPLIT, "usr/node_modules/bootstrap-icons/font/bootstrap-icons.css", func(text string, ls []string) {
if len(ls) > 2 && ls[2] == "content" {
name := "bi " + strings.TrimPrefix(ls[0], ".")
m.Push("name", name)
m.Push("icon", kit.Format(`<i class="%s"></i>`, name))
}
})
m.StatusTimeCount()
}},
})
}