Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

消息模板匹配器 #91

Merged
merged 54 commits into from
Oct 14, 2024
Merged

Conversation

RikaCelery
Copy link
Contributor

旨在提供一种更好的消息匹配方式
避免因可能的onebot扩展导致正则匹配失效

add new Rule `PatternRule`

(cherry picked from commit 44d6c88)

do not modify OnMessage method
engine.go Outdated Show resolved Hide resolved
rules.go Outdated Show resolved Hide resolved
rules.go Outdated Show resolved Hide resolved
rules.go Outdated Show resolved Hide resolved
rules.go Outdated Show resolved Hide resolved
rules.go Outdated Show resolved Hide resolved
rules.go Outdated Show resolved Hide resolved
chained pattern builder
remove useless structs
rename function As... => Get...
parse tests
Getxxx tests
SetOptional tests
…pattern-matcher

# Conflicts:
#	pattern_test.go
(cherry picked from commit 5a945cc)
rules.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@fumiama fumiama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

还需修复lint。

pattern.go Outdated Show resolved Hide resolved
pattern.go Outdated Show resolved Hide resolved
rules.go Outdated Show resolved Hide resolved
@fumiama
Copy link
Collaborator

fumiama commented Oct 12, 2024

还需修复lint。

拉取最新后即可见。

@RikaCelery
Copy link
Contributor Author

要不要加个Any匹配任意消息

@fumiama
Copy link
Collaborator

fumiama commented Oct 13, 2024

要不要加个Any匹配任意消息

也行

@fumiama
Copy link
Collaborator

fumiama commented Oct 13, 2024

其实有一个和你这个实现的比较类似的东西extension/filter,可以参考一下。

@RikaCelery
Copy link
Contributor Author

其实有一个和你这个实现的比较类似的东西extension/filter,可以参考一下。

写的真好看🥳

pattern.go Outdated Show resolved Hide resolved
pattern.go Outdated Show resolved Hide resolved
pattern.go Outdated Show resolved Hide resolved
pattern.go Show resolved Hide resolved
pattern.go Outdated Show resolved Hide resolved
pattern.go Outdated Show resolved Hide resolved
@fumiama fumiama merged commit 4eb4f92 into wdvxdr1123:main Oct 14, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants