fix regex
This commit is contained in:
parent
584ac25c36
commit
4772cd7f71
2
bot.go
2
bot.go
@ -188,7 +188,7 @@ func botPasswd(m *tb.Message) {
|
|||||||
bot.SendChat(m.Chat.ID, "User not registered.")
|
bot.SendChat(m.Chat.ID, "User not registered.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
r := regexp.MustCompile("^\\/register( )+(?P<Passwd>[.^\\ ]+)$")
|
r := regexp.MustCompile("^\\/passwd( )+(?P<Passwd>[^ ]+)$")
|
||||||
if r.MatchString(m.Text) {
|
if r.MatchString(m.Text) {
|
||||||
// we have a parameter
|
// we have a parameter
|
||||||
passwd := r.ReplaceAllString(m.Text, "${Passwd}")
|
passwd := r.ReplaceAllString(m.Text, "${Passwd}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user