File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -397,6 +397,14 @@ print("run[CQ:image,file="+j["img"]+"]")
397
397
398
398
- [x] 支付宝到账 1
399
399
400
+ </details >
401
+ <details >
402
+ <summary >触发者撤回时也自动撤回</summary >
403
+
404
+ ` import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/autowithdraw" `
405
+
406
+ - [x] 撤回一条消息
407
+
400
408
</details >
401
409
<details >
402
410
<summary >base16384加解密</summary >
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ import (
61
61
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/aipaint" // ai绘图
62
62
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/aiwife" // 随机老婆
63
63
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/alipayvoice" // 支付宝到账语音
64
+ _ "github.com/FloatTech/ZeroBot-Plugin/plugin/autowithdraw" // 触发者撤回时也自动撤回
64
65
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/b14" // base16384加解密
65
66
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/baidu" // 百度一下
66
67
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/baiduaudit" // 百度内容审核
Original file line number Diff line number Diff line change
1
+ // Package autowithdraw 触发者撤回时也自动撤回
2
+ package autowithdraw
3
+
4
+ import (
5
+ "github.com/FloatTech/floatbox/process"
6
+ ctrl "github.com/FloatTech/zbpctrl"
7
+ "github.com/FloatTech/zbputils/control"
8
+ zero "github.com/wdvxdr1123/ZeroBot"
9
+ "github.com/wdvxdr1123/ZeroBot/message"
10
+ )
11
+
12
+ func init () {
13
+ control .Register ("autowithdraw" , & ctrl.Options [* zero.Ctx ]{
14
+ DisableOnDefault : false ,
15
+ Brief : "触发者撤回时也自动撤回" ,
16
+ Help : "- 撤回一条消息\n " ,
17
+ }).OnNotice (func (ctx * zero.Ctx ) bool {
18
+ return ctx .Event .NoticeType == "group_recall" || ctx .Event .NoticeType == "friend_recall"
19
+ }).SetBlock (false ).Handle (func (ctx * zero.Ctx ) {
20
+ id , ok := ctx .Event .MessageID .(int64 )
21
+ if ! ok {
22
+ return
23
+ }
24
+ for _ , msg := range zero .GetTriggeredMessages (message .NewMessageIDFromInteger (id )) {
25
+ process .SleepAbout1sTo2s ()
26
+ ctx .DeleteMessage (msg )
27
+ }
28
+ })
29
+ }
You can’t perform that action at this time.
0 commit comments