2024-09-15 20:00:08 +08:00

23 lines
627 B
Go

package gonganxitong
import (
"shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/community/src/gonganxitong/model"
)
type thumb struct{ Table }
func (s thumb) Toggle(m *ice.Message, arg ...string) {
if msg := s.Select(m.Spawn(), m.OptionSimple(model.MARKET_UID, model.USER_UID)...); msg.Length() == 0 {
s.Insert(m.Spawn(), kit.Simple(m.OptionSimple(model.MARKET_UID, model.USER_UID), model.STATUS, 1)...)
m.Echo("1")
} else {
s.AddCount(m.Spawn(), model.STATUS, "1", msg.Append(model.UID))
m.Echo(kit.Format(kit.Int(msg.Append(model.STATUS)) + 1))
}
}
func init() { ice.TeamCtxCmd(thumb{}) }