feat: add rps and dice commands

This commit is contained in:
2025-08-04 23:33:53 +08:00
parent 0330aac5db
commit 111379fbed
4 changed files with 28 additions and 0 deletions

View File

@@ -38,6 +38,8 @@ func init() {
"crypto": cmd_crypto,
"event": cmd_event,
"sh": cmd_sh,
"rps": cmd_rps,
"dice": cmd_dice,
}
for key := range cmdMap {

9
cmds/dice.go Normal file
View File

@@ -0,0 +1,9 @@
package cmds
import (
"go-hurobot/qbot"
)
func cmd_dice(c *qbot.Client, msg *qbot.Message, args *ArgsList) {
c.SendMsg(msg, qbot.CQDice())
}

9
cmds/rps.go Normal file
View File

@@ -0,0 +1,9 @@
package cmds
import (
"go-hurobot/qbot"
)
func cmd_rps(c *qbot.Client, msg *qbot.Message, args *ArgsList) {
c.SendMsg(msg, qbot.CQRps())
}

View File

@@ -21,3 +21,11 @@ func CQRecord(text string) string {
func CQImage(url string) string {
return fmt.Sprintf("[CQ:image,sub_type=0,url=%s]", url)
}
func CQRps() string {
return "[CQ:rps]"
}
func CQDice() string {
return "[CQ:dice]"
}