在golang模板中提及Slack

huangapple go评论88阅读模式
英文:

Slack mentions in golang templates

问题

我正在使用go gitlab包从gitlab获取用户。在我的go模板中,我尝试使用以下语法在slack中标记一个人:@{{.Name}},但是Slack接收到的字符串是@Foo Bar,但实际上并没有标记这个人。是否有任何可用的解决方法?这是slack输出的截图

英文:

I am using go gitlab package to fetch users from gitlab. While trying to tag a person in slack in my go template using the following syntax @{{.Name}} , Slack receives a string @Foo Bar, but the person is not actually being tagged. Are there any workarounds available? Here's the screenshot of slack output

答案1

得分: 0

根据问题中提到的细节。

你正在使用@{{.Name}}

应该使用@SlackId来标记用户,而不是@UserName

要标记用户进行提及,你需要他们的Slack ID**。

英文:

Based on the details mentioned in the question.

You are using @{{.Name}}.

@SlackId should be used to tag a user instead of @UserName

To tag a user for mentions, you will need their Slack ID

huangapple
  • 本文由 发表于 2021年10月16日 04:57:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/69590527.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定