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

QQ权重查询 #500

Merged
merged 34 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6dff747
兽语加密
lianhong2758 Nov 4, 2022
68e8789
统一格式
lianhong2758 Nov 4, 2022
050146f
统一格式
lianhong2758 Nov 4, 2022
f7b4bb6
天气/拼音查询
lianhong2758 Nov 4, 2022
7129997
Update and rename plugin/jiami/jiami.go to .plugin/佳美/jiami.go
lianhong2758 Nov 4, 2022
02d9211
规范化
lianhong2758 Nov 4, 2022
17bc3f0
合并
lianhong2758 Nov 4, 2022
00f88ae
1
lianhong2758 Nov 4, 2022
8a050b7
1
lianhong2758 Nov 4, 2022
c4aec0e
123
lianhong2758 Nov 4, 2022
0b64ea6
123
lianhong2758 Nov 5, 2022
076bb74
123
lianhong2758 Nov 5, 2022
2e87041
更新
lianhong2758 Nov 5, 2022
dac37ee
4
lianhong2758 Nov 5, 2022
01574fe
Merge branch 'FloatTech:master' into master
lianhong2758 Nov 5, 2022
47f61cf
5
lianhong2758 Nov 5, 2022
b0a6679
Merge branch 'master' of github.com:lianhong2758/ZeroBot-Plugin
lianhong2758 Nov 5, 2022
df0198d
继续完善...
lianhong2758 Nov 5, 2022
01ee02f
Merge branch 'FloatTech:master' into master
lianhong2758 Nov 5, 2022
393c684
Merge branch 'FloatTech:master' into master
lianhong2758 Nov 6, 2022
b1df89f
Merge branch 'FloatTech:master' into master
lianhong2758 Nov 7, 2022
ef67378
权重查询
lianhong2758 Nov 8, 2022
b4013b9
Merge branch 'master' of github.com:lianhong2758/ZeroBot-Plugin
lianhong2758 Nov 8, 2022
ef7f2ec
权重查询
lianhong2758 Nov 8, 2022
4e1c73f
Merge branch 'FloatTech:master' into master
lianhong2758 Nov 11, 2022
b0c4d8b
更正插件注册名
lianhong2758 Nov 12, 2022
4b135ff
Merge branch 'master' of github.com:lianhong2758/ZeroBot-Plugin
lianhong2758 Nov 12, 2022
5a1acfc
Merge branch 'FloatTech:master' into master
lianhong2758 Nov 12, 2022
a68a7c7
更正名称
lianhong2758 Nov 12, 2022
17948c0
Merge branch 'master' of github.com:lianhong2758/ZeroBot-Plugin
lianhong2758 Nov 12, 2022
82a8c68
Merge branch 'FloatTech:master' into master
lianhong2758 Nov 15, 2022
ef67b4e
QQ权重查询
lianhong2758 Nov 15, 2022
46ec815
权重查询
lianhong2758 Nov 15, 2022
7ba6a8b
修改正则
lianhong2758 Nov 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,17 @@ NeteaseCloudMusicApi项目地址:https://binaryify.github.io/NeteaseCloudMusicAp

- [x] 重置花名册

</details>
<details>
<summary>权重查询</summary>

`import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/quan"`

- 来看看大家的账号分吧~据说越高越不容易封号哦

- [x] 权重查询+@xxx

- [x] 权重查询+QQ号(为空时匹配触发者QQ)

</details>
<details>
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ import (
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/nsfw" // nsfw图片识别
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/omikuji" // 浅草寺求签
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/qqwife" // 一群一天一夫一妻制群老婆
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/quan" // QQ权重查询
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/qzone" // qq空间表白墙
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/realcugan" // realcugan清晰术
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/reborn" // 投胎
Expand Down
40 changes: 40 additions & 0 deletions plugin/quan/quan.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Package quan qq权重查询
package quan

import (
"fmt"
"github.com/FloatTech/floatbox/web"
ctrl "github.com/FloatTech/zbpctrl"
"github.com/FloatTech/zbputils/control"
zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/message"
"github.com/wdvxdr1123/ZeroBot/utils/helper"
"strconv"
)

const (
quan = "http://tfkapi.top/API/qqqz.php?qq=%v" // api
)

func init() { // 主函数
en := control.Register("quan", &ctrl.Options[*zero.Ctx]{
DisableOnDefault: false,
Brief: "QQ权重查询",
Help: "权重查询方式\n" +
"- 权重查询+@xxx" +
"- 权重查询+QQ号(可以不写,默认本人)",
})
en.OnRegex(`^权重查询\s*(\[CQ:at,qq=)?(\d+)?`).SetBlock(true).Handle(func(ctx *zero.Ctx) {
str := ctx.State["regex_matched"].([]string)[2] //获取uid
if str == "" { //user
str = strconv.FormatInt(ctx.Event.UserID, 10)
}
es, err := web.GetData(fmt.Sprintf(quan, str)) // 将网站返回结果赋值
if err != nil {
ctx.SendChain(message.Text("出现错误捏:", err))
return
}
ctx.SendChain(message.Text(str, helper.BytesToString(es))) // 输出结果
})

}