fix regex

This commit is contained in:
shoopea 2021-11-10 13:02:52 +08:00
parent 584ac25c36
commit 4772cd7f71

2
bot.go
View File

@ -188,7 +188,7 @@ func botPasswd(m *tb.Message) {
bot.SendChat(m.Chat.ID, "User not registered.")
return
}
r := regexp.MustCompile("^\\/register( )+(?P<Passwd>[.^\\ ]+)$")
r := regexp.MustCompile("^\\/passwd( )+(?P<Passwd>[^ ]+)$")
if r.MatchString(m.Text) {
// we have a parameter
passwd := r.ReplaceAllString(m.Text, "${Passwd}")