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

新插件event, 好友申请群聊邀请事件处理 #403

Merged
merged 9 commits into from
Sep 10, 2022

Conversation

Jiang-Red
Copy link
Member

No description provided.

README.md Outdated Show resolved Hide resolved
plugin/event/event.go Outdated Show resolved Hide resolved
@fumiama
Copy link
Member

fumiama commented Sep 9, 2022

位运算问题很大,建议使用穷举法。假设一共3个开关,那么就是8种状态,你可以存储0~7这8个数字分别表示。

Copy link
Member

@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.

另外,建议使用base16384编码flag, 详见 control/cd

@Jiang-Red Jiang-Red requested a review from fumiama September 9, 2022 17:24
Handle(func(ctx *zero.Ctx) {
c, ok := ctx.State["manager"].(*ctrl.Control[*zero.Ctx])
if ok {
su := zero.BotConfig.SuperUsers[0]
now := time.Unix(ctx.Event.Time, 0).Format("2006-01-02 15:04:05")
flag := ctx.Event.Flag
es := base14.EncodeString(flag)
Copy link
Member

Choose a reason for hiding this comment

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

不是这样,flag是个数字,把它弄成一个int64即可。你要是不会,我之后改改。

@fumiama fumiama merged commit b834307 into FloatTech:master Sep 10, 2022
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.

4 participants