diff --git a/NTFServer.go b/NTFServer.go index 3d4e74c..cf9d20c 100644 --- a/NTFServer.go +++ b/NTFServer.go @@ -5,6 +5,7 @@ import ( "fmt" "html" "log" + "regexp" "sort" "strings" "sync" @@ -545,6 +546,9 @@ func (this *NTFServer) HandleDirectMessage(update telegram.Update) error { } else if strings.HasPrefix(msg, "/join ") { requestedHubNick := msg[6:] + // Some users take the [] in the message literally. A-Za-z0-9 are the only supported characters + requestedHubNick = regexp.MustCompile(`[^a-zA-Z0-9]`).ReplaceAllString(requestedHubNick, "") + // Minimum nick lengths if len(requestedHubNick) < this.config.HubNickMinChars { return respond(fmt.Sprintf("Upstream nickname '%s' should be at least %d characters long", requestedHubNick, this.config.HubNickMinChars))