1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-27 01:48:27 +08:00
icebergs/misc/bash/grant.go
2022-01-02 22:02:27 +08:00

22 lines
528 B
Go

package bash
import (
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/mdb"
)
const GRANT = "grant"
func init() {
Index.Merge(&ice.Context{Commands: map[string]*ice.Command{
"grant": {Name: "grant sid auto", Help: "授权", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
if len(arg) > 0 {
if m.Confirm("grant "+arg[0]+"?") == ice.TRUE {
m.Cmdy(SESS, mdb.MODIFY, GRANT, m.Option(ice.MSG_USERNAME), ice.Option{mdb.HASH, arg[0]})
}
}
m.Cmdy(SESS, arg)
}},
}})
}