From 5a9a5666941e7761a4390b172d3edb09c56bffb4 Mon Sep 17 00:00:00 2001 From: haibaraguo Date: Sun, 5 Sep 2021 14:39:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8=E5=8A=A0?= =?UTF-8?q?=E7=BE=A4,=E5=8A=A0=E5=A5=BD=E5=8F=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++++ plugin_qingyunke/picture.go | 2 +- plugin_qingyunke/qingyunke.go | 1 + plugin_qingyunke/request.go | 22 ++++++++++++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 plugin_qingyunke/request.go diff --git a/README.md b/README.md index 19fac1e5..b2778479 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,12 @@ - [x] 搜卡[xxxx] - [x] [卡组代码xxx] - 注:更多搜卡指令参数:https://hs.fbigame.com/misc/searchhelp +- **青云客** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_qingyunke"` + - [x] @Bot 任意文本(任意一句话回复) + - [x] /daily(群定时发早晚安) + - [x] @Bot 任意图片|任意表情(用图片回复图片表情) + - [x] 关闭自动回复 + - [x] 启动自动回复 - **TODO...** ## 使用方法 diff --git a/plugin_qingyunke/picture.go b/plugin_qingyunke/picture.go index 36526813..94ca378b 100644 --- a/plugin_qingyunke/picture.go +++ b/plugin_qingyunke/picture.go @@ -12,7 +12,7 @@ import ( var ( reImg = `https?://[^"]+?(\.((jpg)|(png)|(jpeg)|(gif)|(bmp)))` ) - +//取图片 func getPicture() string { prefix := "https://fabiaoqing.com/tag/detail/id/5682/page" url := fmt.Sprintf("%d.html", rand.Intn(11)+1) diff --git a/plugin_qingyunke/qingyunke.go b/plugin_qingyunke/qingyunke.go index b0986048..2967aa37 100644 --- a/plugin_qingyunke/qingyunke.go +++ b/plugin_qingyunke/qingyunke.go @@ -99,6 +99,7 @@ type QYData struct { Content string `json:"content"` } +//青云客取消息 func getMessage(msg string) string { url := "http://api.qingyunke.com/api.php" key := "free" diff --git a/plugin_qingyunke/request.go b/plugin_qingyunke/request.go new file mode 100644 index 00000000..b1a08835 --- /dev/null +++ b/plugin_qingyunke/request.go @@ -0,0 +1,22 @@ +package qingyunke +import ( + + zero "github.com/wdvxdr1123/ZeroBot" + "log" + +) +//自动同意加群,加好友 +func init() { + zero.OnRequest().SetBlock(false).FirstPriority().Handle(func(ctx *zero.Ctx) { + if ctx.Event.RequestType == "friend"{ + log.Println("加好友") + ctx.SetFriendAddRequest(ctx.Event.Flag,true,"") + } + if ctx.Event.RequestType == "group" && ctx.Event.SubType == "invite"{ + log.Println("加群") + ctx.SetGroupAddRequest(ctx.Event.Flag,"invite",true,"我爱你,mua~") + } + }) + + +}