From 4772cd7f718eb50bc3ca1926cc4e6174e61bb917 Mon Sep 17 00:00:00 2001 From: shoopea Date: Wed, 10 Nov 2021 13:02:52 +0800 Subject: [PATCH] fix regex --- bot.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.go b/bot.go index 66c2e77..fe892e2 100644 --- a/bot.go +++ b/bot.go @@ -188,7 +188,7 @@ func botPasswd(m *tb.Message) { bot.SendChat(m.Chat.ID, "User not registered.") return } - r := regexp.MustCompile("^\\/register( )+(?P[.^\\ ]+)$") + r := regexp.MustCompile("^\\/passwd( )+(?P[^ ]+)$") if r.MatchString(m.Text) { // we have a parameter passwd := r.ReplaceAllString(m.Text, "${Passwd}")