diff --git a/pkg/services/rocketchat/rocketchat_config.go b/pkg/services/rocketchat/rocketchat_config.go index d6fbfd5b..d09d9f9f 100644 --- a/pkg/services/rocketchat/rocketchat_config.go +++ b/pkg/services/rocketchat/rocketchat_config.go @@ -3,9 +3,10 @@ package rocketchat import ( "errors" "fmt" - "github.com/containrrr/shoutrrr/pkg/services/standard" "net/url" "strings" + + "github.com/containrrr/shoutrrr/pkg/services/standard" ) // Config for the rocket.chat service @@ -48,7 +49,9 @@ func (config *Config) SetURL(serviceURL *url.URL) error { config.TokenA = path[1] config.TokenB = path[2] if len(path) > 3 { - if path[3][0:1] != "@" { + if serviceURL.Fragment != "" { + config.Channel = "#" + strings.TrimPrefix(serviceURL.Fragment, "#") + } else if !strings.HasPrefix(path[3], "@") { config.Channel = "#" + path[3] } else { config.Channel = path[3]