mirror of
https://github.com/awfufu/go-hurobot.git
synced 2026-03-01 05:29:43 +08:00
feat: add rps and dice commands
This commit is contained in:
@@ -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
9
cmds/dice.go
Normal 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
9
cmds/rps.go
Normal 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())
|
||||
}
|
||||
@@ -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]"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user