2
0
mirror of https://github.com/42wim/matterbridge synced 2024-11-03 15:40:24 +00:00

Update regex for usergroup matching. Closes #379

This commit is contained in:
Wim 2018-03-05 20:56:33 +01:00
parent 8d2ce56c37
commit ab94b5ca7a

View File

@ -368,7 +368,7 @@ func (b *Bslack) replaceChannel(text string) string {
// @see https://api.slack.com/docs/message-formatting#variables
func (b *Bslack) replaceVariable(text string) string {
results := regexp.MustCompile(`<!((?:subteam\^)?[a-zA-Z0-9]+)(?:\|(.+?))?>`).FindAllStringSubmatch(text, -1)
results := regexp.MustCompile(`<!((?:subteam\^)?[a-zA-Z0-9]+)(?:\|@?(.+?))?>`).FindAllStringSubmatch(text, -1)
for _, r := range results {
if r[2] != "" {
text = strings.Replace(text, r[0], "@"+r[2], -1)