diff --git a/atri/RocketPunch.amr b/atri/RocketPunch.amr new file mode 100644 index 00000000..e32116e1 Binary files /dev/null and b/atri/RocketPunch.amr differ diff --git a/atri/atri.go b/atri/atri.go index 461e9eee..52b5b37a 100644 --- a/atri/atri.go +++ b/atri/atri.go @@ -28,9 +28,14 @@ func init() { // 插件主体 ENABLE = false ctx.SendChain(randText("Zzz……Zzz……")) }) - zero.OnKeywordGroup([]string{"萝卜子"}, AtriSwitch(), AtriSleep()).SetBlock(true).SetPriority(PRIO). + zero.OnFullMatch("萝卜子", AtriSwitch(), AtriSleep()).SetBlock(true).SetPriority(PRIO). Handle(func(ctx *zero.Ctx) { - ctx.SendChain(randText("萝卜子是对机器人的蔑称!", "是亚托莉......萝卜子可是对机器人的蔑称")) + switch rand.Intn(2) { + case 0: + ctx.SendChain(randText("萝卜子是对机器人的蔑称!", "是亚托莉......萝卜子可是对机器人的蔑称")) + case 1: + ctx.SendChain(randRecord("RocketPunch.amr")) + } }) zero.OnKeywordGroup([]string{"喜欢", "爱你", "爱", "suki", "daisuki", "すき", "好き", "贴贴", "老婆", "亲一个", "mua"}, AtriSwitch(), AtriSleep(), zero.OnlyToMe).SetBlock(true).SetPriority(PRIO). Handle(func(ctx *zero.Ctx) { @@ -220,6 +225,11 @@ func randImage(file ...string) message.MessageSegment { return message.Image(RES + file[rand.Intn(length)]) } +func randRecord(file ...string) message.MessageSegment { + length := len(file) + return message.Image(RES + file[rand.Intn(length)]) +} + // AtriSwitch 控制 ATRI 的开关 func AtriSwitch() zero.Rule { return func(ctx *zero.Ctx) bool {