Skip to content

Commit

Permalink
fixup! rename containsOptional to mustMatchAllPatterns
Browse files Browse the repository at this point in the history
  • Loading branch information
RikaCelery committed Oct 13, 2024
1 parent 4e89e07 commit 78ce239
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (p *Pattern) AsRule() Rule {
if ctx.Event.Message[i-1].Type == "reply" && ctx.Event.Message[i].Type == "at" {
// [reply][at]
reply := ctx.GetMessage(ctx.Event.Message[i-1].Data["id"])
if reply.MessageID.ID() != 0 && reply.Sender != nil && reply.Sender.ID != 0 && strconv.FormatInt(reply.Sender.ID, 10) == ctx.Event.Message[i].Data["qq"] {
if reply.MessageID.ID() != 0 && reply.Sender != nil && reply.Sender.ID != 0 && strconv.FormatInt(reply.Sender.ID, 10) == ctx.Event.Message[i].Data["qq"] {
continue
}
}
Expand Down Expand Up @@ -174,7 +174,7 @@ func (p *Pattern) Reply() *Pattern {
}
func mustMatchAllPatterns(pattern Pattern) bool {
for _, p := range pattern {
if !p.Optional {
if p.Optional {
return false
}
}
Expand Down

0 comments on commit 78ce239

Please sign in to comment.