-
Notifications
You must be signed in to change notification settings - Fork 2k
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
新增统计睡眠时间和添加协程里的异常捕获 #84
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update manager.go (#83)
✏️ dep: use RomiChan/protobuf
fumiama
requested changes
Dec 3, 2021
fumiama
requested changes
Dec 4, 2021
主要是我想让用户更加简单的触发help,那个打印的是服务列表+用法的全部信息,有很多功能不知道,要知道用法需要两步有点难搞
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2021年12月4日(星期六) 中午11:42
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [FloatTech/ZeroBot-Plugin] 新增统计睡眠时间和添加协程里的异常捕获 (PR #84)
@fumiama requested changes on this pull request.
In main.go:
> @@ -118,8 +120,9 @@ func printBanner() { func main() { printBanner() // 帮助 - zero.OnFullMatchGroup([]string{"/help", ".help", "菜单"}, zero.OnlyToMe).SetBlock(true).FirstPriority(). + zero.OnFullMatchGroup([]string{"/help", ".help", "help", "帮助", "菜单"}, zero.OnlyToMe).SetBlock(true).FirstPriority().
不要添加"help", "帮助",会和青云客的帮助冲突
In main.go:
> Handle(func(ctx *zero.Ctx) { + ctx.SendChain(message.Text(control.TotalHelp(ctx.Event.GroupID)))
直接打印全部列表会显得过于冗长,建议只是提示"发送 /服务列表 以查看所有服务",不要这个TotalHelp了
In control/rule.go:
> @@ -215,6 +215,25 @@ func copyMap(m map[string]*Control) map[string]*Control { return ret } +func TotalHelp(gid int64) (msg string) {
理由见下方,建议还原更改。
In plugin_manager/manager.go:
> @@ -3,6 +3,7 @@ package manager import ( "fmt" + "github.com/FloatTech/ZeroBot-Plugin/control"
这个需要移动到import最下方,与其他包空一行
In plugin_manager/manager.go:
> @@ -66,12 +71,12 @@ func init() { // 插件主体 clock = timer.NewClock(timerfile) }() // 菜单 - zero.OnFullMatch("群管系统", zero.AdminPermission).SetBlock(true).FirstPriority(). + engine.OnFullMatch("群管系统", zero.AdminPermission).SetBlock(true).FirstPriority().
既然有了help,群管系统这个命令就不再需要了,可以移除
In plugin_manager/manager.go:
> @@ -116,15 +121,15 @@ func init() { // 插件主体 ctx.SendChain(message.Text("残念~ " + nickname + " 被放逐")) }) // 退出群聊 - zero.OnRegex(`^退出群聊.*?(\d+)`, zero.OnlyGroup, zero.AdminPermission).SetBlock(true).SetPriority(40). + engine.OnRegex(`^退出群聊.*?(\d+)`, zero.OnlyGroup, zero.SuperUserPermission).SetBlock(true).SetPriority(40).
这里可以把zero.OnlyGroup也改成zero.OnlyToMe
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
但是实在太长了... |
我会改成合并消息
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2021年12月4日(星期六) 中午11:51
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [FloatTech/ZeroBot-Plugin] 新增统计睡眠时间和添加协程里的异常捕获 (PR #84)
主要是我想让用户更加简单的触发help,那个打印的是服务列表+用法的全部信息,有很多功能不知道,要知道用法需要两步有点难搞
但是实在太长了...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
可以,不过建议另外用别的关键词触发,help还是保持简洁,仅提示这个触发关键词,以及 /服务列表 + /用法 的两级查询结构。 |
fumiama
approved these changes
Dec 4, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有其他更改我就合并了
没有了
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2021年12月4日(星期六) 晚上8:43
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [FloatTech/ZeroBot-Plugin] 新增统计睡眠时间和添加协程里的异常捕获 (PR #84)
@fumiama approved this pull request.
没有其他更改我就合并了
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.