Slack中的Slash命令

发布于 2025-02-06 05:27:22 字数 150 浏览 1 评论 0原文

在Slack中,是否可以为将消息发布到不同频道的应用程序创建命令? 这就是我要实现的目标: 我从我的DM运行斜线命令,该命令将在频道中发布消息,而我不是我的一部分。 现在,该频道的成员运行另一个命令来回复我,我的回复应由我的应用程序的消息或同一频道中收到,但仅对我可见。 这可以实现吗?

In SLACK, Is it possible to create commands for an app which post messages to different channels?
This is what I am trying to achieve:
I run a Slash command from my DM which will post a message in a channel, which I am not a part of.
A member of that channel now runs another command to reply me and his response should be received by me either in my app’s messages or in the same channel but visible to me only.
Can this be achieved ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

或十年 2025-02-13 05:27:23

机器人令牌(xoxb)可以使用chat.postmessage [chat:chat:with:witr with: /public] [1] 范围。为此,机器人不需要成为频道的成员。如果您将其用户ID作为channel参数中的参数传递给chat.postmessage,则该机器人也可以将1:1 dms发送给用户。要发布到私人频道或多人DM中,它不是成员。要向只能由特定用户查看的通道内发送消息,请查看[CHAT.POSTEPHEMERAL] [1],看到此消息的用户必须是频道的成员。

A bot token, (xoxb) can send messages to any public channel using the chat.postMessage method and the [chat:write/public][1] scope. For that, the bot does not need to be a member of the channel. The bot can also send 1:1 DMs to users if you pass their user id as the channel parameter in a call to chat.postMessage but the bot won't be able to post into a private channel or multi-person DM it is not a member of. To send messages in-channel that can only be viewed by a specific user, check out [chat.postEphemeral][1], the user seeing this message must be a member of the channel.

記憶穿過時間隧道 2025-02-13 05:27:23

您在问题中提到的问题可以使用Slack的'互动性'功能。 (slash命令& app快捷方式)

您需要实现代码以捕获“命令”,然后使用Slack的WebApis实现结果。

chat apis

What you mentioned in the question can be achieved using Slack's 'Interactivity' features. (Slash Commands & App Shortcuts)

You'll need to implement code to capture 'command', and then use Slack's WebAPIs to achieve the result.

(Chat APIs)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文