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 { if oc, ok := waits.LoadOrStore(key, c); ok {
oc.(*Carry).Chan <- InterruptError oc.(*Carry).Chan <- InterruptError
} }
fmt.Println(key)
fmt.Println(waits.Load(key))
select { select {
case result := <-c.Chan: case result := <-c.Chan:
switch result.(type) { switch result.(type) {
+7 -6
View File
@@ -257,12 +257,13 @@ Alias=sillyGirl.service`
Admin: true, Admin: true,
Rules: []string{"raw .*pornhub.*"}, Rules: []string{"raw .*pornhub.*"},
Handle: func(s Sender) interface{} { Handle: func(s Sender) interface{} {
s.Reply("你已涉黄将被禁言300秒。") s.Reply("你已涉黄永久禁言。")
s.Await(s, func(_ string, s2 Sender, _ error) interface{} { for {
s2.Disappear(time.Millisecond * 50) s.Await(s, func(_ string, s2 Sender, _ error) interface{} {
return "你已被禁言。" s2.Disappear(time.Millisecond * 50)
}, `[\s\S]*`, time.Duration(time.Second*300)) return "你已被禁言。"
return "发送成功呢" }, `[\s\S]*`, time.Duration(time.Second*300))
}
}, },
}, },
}) })