Skip to content

Commit

Permalink
规范化
Browse files Browse the repository at this point in the history
  • Loading branch information
lianhong2758 committed Nov 4, 2022
1 parent f7b4bb6 commit 02d9211
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions plugin/jiami/jiami.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,16 @@ func init() { // 主函数
es, err := web.GetData(fmt.Sprintf(jiami1, str)) // 将网站返回结果赋值
if err != nil {
ctx.SendChain(message.Text("出现错误捏:", err))
return
}

// es1 := fmt.Sprintf("%s", es)
var r nmd // r数组
err = json.Unmarshal(es, &r) // 填api返回结果,struct地址
if err != nil {
ctx.SendChain(message.Text("出现错误捏:", err))
return
}

/*if es != "" {
ctx.SendChain(message.Text(es))
} else {
ctx.SendChain(message.Text("加密失败!"))
}*/

ctx.SendChain(message.Text(r.Data.Message)) // 输出提取后的结果
})

Expand All @@ -64,6 +59,7 @@ func init() { // 主函数
es, err := web.GetData(fmt.Sprintf(jiami2, str)) // 将网站返回结果赋值
if err != nil {
ctx.SendChain(message.Text("出现错误捏:", err))
return
}
var n nmd // r数组
err = json.Unmarshal(es, &n) // 填api返回结果,struct地址
Expand Down

0 comments on commit 02d9211

Please sign in to comment.