On slack - 我可以使用以下文本语法直接从我的两者中标记用户:
hello Francois <@francois>
我想对群组执行同样的操作(不幸的是,我的应用程序只知道群组名称,不知道群组 ID)。是否有这样做的语法 - 以下语法不起作用:
hello group <@group>
最佳答案
这取决于您所说的“组”是什么意思。
- 私有(private) channel 被 Slack API 称为群组(例如
groups.list
) - 可以将用户分配到称为用户组的功能组
在内部由 Slack api(仅付费 Slack,例如
usergroups.list
)
对于 1) @提及将不起作用。相反,您可以发送 <!channel>
进入私有(private) channel 同样的效果。
对于 2),语法是 <!subteam^ID|handle>
请参阅 documentation 的摘录关于如何使用它们:
For paid account there is an additional command for User Groups that follows the format . (subteam is literal text. ID and handle are replaced with the details of the group.) These indicate a User Group message, and should cause a notification to be displayed by the client. User Group IDs can be determined from the usergroups.list API endpoint. For example, if you have a User Group named happy-peeps with ID of S012345, then you would use the command to mention that user group in a message.
如果您只有用户组名称并且需要 ID,您可以使用 usergroups.list
得到对应的ID。
关于slack - 使用 slack 上的机器人标记仅知道名称的用户组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49577969/