-
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
✨ 添加bilibilipush和完善gif文档 #369
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
fumiama
requested changes
Aug 11, 2022
已修改
Sent from my iPhone
…------------------ 原始邮件 ------------------
发件人: 源文雨 ***@***.***>
发送时间: 2022年8月11日 09:44
收件人: FloatTech/ZeroBot-Plugin ***@***.***>
抄送: himawari ***@***.***>, Author ***@***.***>
主题: Re: [FloatTech/ZeroBot-Plugin] ✨ 添加bilibilipush和完善gif文档 (PR #369)
@fumiama requested changes on this pull request.
In plugin/bilibili/bilibilipush.go:
> +} +}) +} + +// 储存up的name,uid +func checkBuid(buid int64) (status int, name string, err error) { +data, err := web.RequestDataWith(web.NewDefaultClient(), fmt.Sprintf(infoURL, buid), "GET", referer, ua) +if err != nil { +return +} +status = int(gjson.Get(binary.BytesToString(data), "code").Int()) +name = gjson.Get(binary.BytesToString(data), "data.name").String() +if status == 0 { +bdb.insertBilibiliUp(buid, name) +upMap[buid] = name +}
else err=...
In plugin/bilibili/bilibilipush.go:
> +err = errors.New(msg) +return +} +} +return +} + +// subscribe 订阅 +func subscribe(buid, groupid int64) (err error) { +bpMap := map[string]interface{}{ +"bilibili_uid": buid, +"group_id": groupid, +"live_disable": 0, +"dynamic_disable": 0, +} +err = bdb.insertOrUpdateLiveAndDynamic(bpMap)
return bdb.insertOrUpdateLiveAndDynamic(bpMap)
其他同理
In plugin/bilibili/bilibilipushmodel.go:
> +} +defer f.Close() +} +gdb, err := gorm.Open("sqlite3", dbpath) +if err != nil { +panic(err) +} +gdb.AutoMigrate(&bilibilipush{}).AutoMigrate(&bilibiliup{}) +return (*bilibilipushdb)(gdb) +} + +// insertOrUpdateLiveAndDynamic 插入或更新数据库 +func (bdb *bilibilipushdb) insertOrUpdateLiveAndDynamic(bpMap map[string]interface{}) (err error) { +db := (*gorm.DB)(bdb) +bp := bilibilipush{} +data, _ := json.Marshal(&bpMap)
err判断,其他同理
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
fumiama
approved these changes
Aug 11, 2022
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.