Skip to content

Commit 4d9397b

Browse files
committed
优化截图提示
1 parent bf334f4 commit 4d9397b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

plugin/dnf/dnf.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ func init() {
1818
订阅colg资讯 指令 订阅colg资讯`,
1919
})
2020

21-
engine.OnPrefixGroup([]string{"比例", "金币", "游戏币"}).SetBlock(true).Handle(
21+
engine.OnPrefixGroup([]string{"比例", "金币", "游戏币"}, IfSever).SetBlock(true).Handle(
2222
func(ctx *zero.Ctx) {
23+
ctx.SendChain(message.Text(zero.BotConfig.GetNickName(ctx.Event.SelfID)[0] + "在查了在查了。。。"))
2324
arg := ctx.State["args"].(string)
2425
data, url, err := service.Screenshot(arg, "youxibi")
2526
if err != nil {
@@ -32,8 +33,9 @@ func init() {
3233
ctx.SendChain(message.At(ctx.Event.UserID), message.ImageBytes(data), message.Text(url))
3334
})
3435

35-
engine.OnPrefixGroup([]string{"矛盾"}).SetBlock(true).Handle(
36+
engine.OnPrefixGroup([]string{"矛盾"}, IfSever).SetBlock(true).Handle(
3637
func(ctx *zero.Ctx) {
38+
ctx.SendChain(message.Text(zero.BotConfig.GetNickName(ctx.Event.SelfID)[0] + "在查了在查了。。。"))
3739
arg := ctx.State["args"].(string)
3840
data, url, err := service.Screenshot(arg, "maodun")
3941
if err != nil {
@@ -129,3 +131,8 @@ func init() {
129131
}
130132
}()
131133
}
134+
135+
func IfSever(ctx *zero.Ctx) bool {
136+
_, ok := service.ReportRegions[ctx.State["args"].(string)]
137+
return ok
138+
}

plugin/dnf/service/yxdr.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ func Screenshot(server string, productType string) ([]byte, string, error) {
5252

5353
// 导航到指定的URL
5454
var buf []byte
55-
// url := "https://www.baidu.com"
5655
url := fmt.Sprintf("https://www.yxdr.com/bijiaqi/dnf/%s/kua%s", productType, ReportRegions[server])
5756
err := chromedp.Run(ScCtx,
5857
chromedp.Navigate(url),

0 commit comments

Comments
 (0)