This commit is contained in:
cdle
2021-10-11 20:06:50 +08:00
parent cdce7002ab
commit 0594da99b4
4 changed files with 46 additions and 28 deletions
+2 -4
View File
@@ -81,12 +81,10 @@ func AddCommand(prefix string, cmds []Function) {
func handleMessage(sender Sender) {
defer sender.Finish()
key := fmt.Sprintf("u=%v&c=%v&i=%v", sender.GetUserID(), sender.GetChatID(), sender.GetImType())
// fmt.Println(key, sender.GetContent())
// fmt.Println(waits.Load(key))
if v, ok := waits.Load(key); ok {
c := v.(Carry)
c := v.(*Carry)
if m := regexp.MustCompile(c.Pattern).FindString(sender.GetContent()); m != "" {
c.Sender = sender
c.Chan <- m
sender.Reply(<-c.Result)
return