5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 09:20:27 +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)