Files
go-hurobot/cmds/rps.go
AkashiNeko abbe419bf8 refactor: replace WebSocket with bidirectional HTTP for NapCat communication
refactor: migrate command handling from function pointers to object-oriented interface
feat: replace run.sh with YAML-based configuration file
2025-10-31 20:30:39 +08:00

35 lines
609 B
Go

package cmds
import (
"go-hurobot/qbot"
)
const rpsHelpMsg string = `Play rock-paper-scissors.
Usage: /rps`
type RpsCommand struct {
cmdBase
}
func NewRpsCommand() *RpsCommand {
return &RpsCommand{
cmdBase: cmdBase{
Name: "rps",
HelpMsg: rpsHelpMsg,
Permission: getCmdPermLevel("rps"),
AllowPrefix: false,
NeedRawMsg: false,
MaxArgs: 1,
MinArgs: 1,
},
}
}
func (cmd *RpsCommand) Self() *cmdBase {
return &cmd.cmdBase
}
func (cmd *RpsCommand) Exec(c *qbot.Client, args []string, src *srcMsg, _ int) {
c.SendMsg(src.GroupID, src.UserID, qbot.CQRps())
}