diff --git a/core/im.go b/core/im.go index 7befa16..2227b89 100644 --- a/core/im.go +++ b/core/im.go @@ -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) { diff --git a/core/test.go b/core/test.go index c203e59..3f3c415 100644 --- a/core/test.go +++ b/core/test.go @@ -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)) + } }, }, })