mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-22 02:32:02 -08:00
Update regex for usergroup matching. Closes #379
This commit is contained in:
parent
8d2ce56c37
commit
ab94b5ca7a
@ -368,7 +368,7 @@ func (b *Bslack) replaceChannel(text string) string {
|
|||||||
|
|
||||||
// @see https://api.slack.com/docs/message-formatting#variables
|
// @see https://api.slack.com/docs/message-formatting#variables
|
||||||
func (b *Bslack) replaceVariable(text string) string {
|
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 {
|
for _, r := range results {
|
||||||
if r[2] != "" {
|
if r[2] != "" {
|
||||||
text = strings.Replace(text, r[0], "@"+r[2], -1)
|
text = strings.Replace(text, r[0], "@"+r[2], -1)
|
||||||
|
Loading…
Reference in New Issue
Block a user