This commit is contained in:
cdle
2021-10-11 20:50:50 +08:00
parent ae6f819283
commit bdbb2ec9c4
2 changed files with 7 additions and 8 deletions
-2
View File
@@ -252,8 +252,6 @@ func (_ *BaseSender) Await(sender Sender, callback func(string, Sender, error) i
if oc, ok := waits.LoadOrStore(key, c); ok {
oc.(*Carry).Chan <- InterruptError
}
fmt.Println(key)
fmt.Println(waits.Load(key))
select {
case result := <-c.Chan:
switch result.(type) {
+7 -6
View File
@@ -257,12 +257,13 @@ Alias=sillyGirl.service`
Admin: true,
Rules: []string{"raw .*pornhub.*"},
Handle: func(s Sender) interface{} {
s.Reply("你已涉黄将被禁言300秒。")
s.Await(s, func(_ string, s2 Sender, _ error) interface{} {
s2.Disappear(time.Millisecond * 50)
return "你已被禁言。"
}, `[\s\S]*`, time.Duration(time.Second*300))
return "发送成功呢"
s.Reply("你已涉黄永久禁言。")
for {
s.Await(s, func(_ string, s2 Sender, _ error) interface{} {
s2.Disappear(time.Millisecond * 50)
return "你已被禁言。"
}, `[\s\S]*`, time.Duration(time.Second*300))
}
},
},
})