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

更新ZeroBot至git版本,升级go到1.20 #33

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RikaCelery
Copy link
Contributor

go => 1.20
logrus => 1.9.3
gjson => 1.17.3
[new]: golang.org/x/net v0.21.0
ZeroBot => git

logrus => 1.9.3
gjson => 1.17.3
[new]: golang.org/x/net v0.21.0
ZeroBot => git
@@ -71,7 +71,7 @@ func NewPluginManager() *PluginManager {
}
// 添加前置Pre Hook
m.engine.UsePreHandler(rules.SkipGuildMessage) // TODO 暂时忽略所有频道消息,原因:ZeroBot无法正常发送频道消息
m.engine.UsePreHandler(m.preHandlerWithHook)
m.engine.UseMidHandler(m.preHandlerWithHook)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里ZeroBot更改了PreHandler的定义,PreHandler会在Rule匹配之前被调用
而MidHandler会在Rule之后被调用,符合原本的效果

@RikaCelery
Copy link
Contributor Author

升级go主要是ZeroBot那边需要go 1.20

@@ -257,33 +256,30 @@ func GetBotNickname() string {

// GetBotID 获取机器人的登录ID
func GetBotID() int64 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

多Bot情况无法处理,删除这个API?

NickName: []string{viper.GetString("nickname")},
CommandPrefix: "",
SuperUsers: viper.GetStringSlice("superuser"),
CommandPrefix: viper.GetString("command_prefix"),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里添加了一个新的配置项command_prefix

@RikaCelery RikaCelery mentioned this pull request Feb 12, 2025
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.

1 participant