Skip to content

Slack 节点#

使用 Slack 节点在 Slack 中自动化工作,并将 Slack 与其他应用程序集成。n8n 内置支持广泛的 Slack 功能,包括创建、存档和关闭频道、获取用户和文件,以及删除消息。

在此页面上,您将找到 Slack 节点支持的操作列表以及更多资源的链接。

凭据

请参考 Slack 凭据 获取设置身份验证的指导。

操作#

  • Channel 频道
    • Archive 存档 a channel. 存档频道。
    • Close 关闭 a direct message or multi-person direct message. 关闭私信或多人私信。
    • Create 创建 a public or private channel-based conversation. 创建公开或私人基于频道的对话。
    • Get 获取 information about a channel. 获取频道信息。
    • Get Many 获取多个: Get a list of channels in Slack. 获取 Slack 中的频道列表。
    • History 历史记录: Get a channel's history of messages and events. 获取频道的消息和事件历史记录。
    • Invite 邀请 a user to a channel. 邀请用户到频道。
    • Join 加入 an existing channel. 加入现有频道。
    • Kick 踢出: Remove a user from a channel. 从频道中移除用户。
    • Leave 离开 a channel. 离开频道。
    • Member 成员: List the members of a channel. 列出频道成员。
    • Open 打开 or resume a direct message or multi-person direct message. 打开或恢复私信或多人私信。
    • Rename 重命名 a channel. 重命名频道。
    • Replies 回复: Get a thread of messages posted to a channel. 获取发布到频道的消息线程。
    • Sets purpose 设置目的 of a channel. 设置频道目的。
    • Sets topic 设置主题 of a channel. 设置频道主题。
    • Unarchive 取消存档 a channel. 取消存档频道。
  • File 文件
    • Get 获取 a file. 获取文件。
    • Get Many 获取多个: Get and filter team files. 获取和过滤团队文件。
    • Upload 上传: Create or upload an existing file. 创建或上传现有文件。
  • Message 消息
    • Delete 删除 a message 删除消息
    • Get permalink 获取永久链接: Get a message's permalink. 获取消息的永久链接。
    • Search 搜索 for messages 搜索消息
    • Send 发送 a message 发送消息
    • Send and Wait for Approval 发送并等待批准: Send a message and wait for approval from the recipient before continuing. 发送消息并等待接收者批准后再继续。
    • Update 更新 a message 更新消息
  • Reaction 反应
    • Add 添加 a reaction to a message. 向消息添加反应。
    • Get 获取 a message's reactions. 获取消息的反应。
    • Remove 移除 a reaction from a message. 从消息中移除反应。
  • Star 星标
    • Add 添加 a star to an item. 向项目添加星标。
    • Delete 删除 a star from an item. 从项目中删除星标。
    • Get Many 获取多个: Get a list of an authenticated user's stars. 获取已认证用户的星标列表。
  • User 用户
    • Get 获取 information about a user. 获取用户信息。
    • Get Many 获取多个: Get a list of users. 获取用户列表。
    • Get User's Profile 获取用户资料.
    • Get User's Status 获取用户状态.
    • Update User's Profile 更新用户资料.
  • User Group 用户组
    • Create 创建 a user group. 创建用户组。
    • Disable 禁用 a user group. 禁用用户组。
    • Enable 启用 a user group. 启用用户组。
    • Get Many 获取多个: Get a list of user groups. 获取用户组列表。
    • Update 更新 a user group. 更新用户组。

模板和示例#

Back Up Your n8n Workflows To Github

by Jonathan

View template details
Slack chatbot powered by AI

by n8n Team

View template details
Advanced AI Demo (Presented at AI Developers #14 meetup)

by Max Tkacz

View template details
Browse Slack integration templates, or search all templates

相关资源#

请参考 Slack 的文档 以获取有关该服务的更多信息。

必需的范围#

为您的 Slack 凭据 创建 Slack 应用后,您必须向 Slack 应用添加适当的范围,此节点才能正常工作。首先使用 范围 | Slack 凭据 页面中列出的范围。

如果这些还不够,请使用下表查找您要使用的资源和操作,然后点击链接到 Slack API 文档以找到正确的范围。

Resource 资源 Operation 操作 Slack API method Slack API 方法
Channel 频道 Archive 存档 conversations.archive
Channel 频道 Close 关闭 conversations.close
Channel 频道 Create 创建 conversations.create
Channel 频道 Get 获取 conversations.info
Channel 频道 Get Many 获取多个 conversations.list
Channel 频道 History 历史记录 conversations.history
Channel 频道 Invite 邀请 conversations.invite
Channel 频道 Join 加入 conversations.join
Channel 频道 Kick 踢出 conversations.kick
Channel 频道 Leave 离开 conversations.leave
Channel 频道 Member 成员 conversations.members
Channel 频道 Open 打开 conversations.open
Channel 频道 Rename 重命名 conversations.rename
Channel 频道 Replies 回复 conversations.replies
Channel 频道 Set Purpose 设置目的 conversations.setPurpose
Channel 频道 Set Topic 设置主题 conversations.setTopic
Channel 频道 Unarchive 取消存档 conversations.unarchive
File 文件 Get 获取 files.info
File 文件 Get Many 获取多个 files.list
File 文件 Upload 上传 files.upload
Message 消息 Delete 删除 chat.delete
Message 消息 Get Permalink 获取永久链接 chat.getPermalink
Message 消息 Search 搜索 search.messages
Message 消息 Send 发送 chat.postMessage
Message 消息 Send and Wait for Approval 发送并等待批准 chat.postMessage
Message 消息 Update 更新 chat.update
Reaction 反应 Add 添加 reactions.add
Reaction 反应 Get 获取 reactions.get
Reaction 反应 Remove 移除 reactions.remove
Star 星标 Add 添加 stars.add
Star 星标 Delete 删除 stars.remove
Star 星标 Get Many 获取多个 stars.list
User 用户 Get 获取 users.info
User 用户 Get Many 获取多个 users.list
User 用户 Get User's Profile 获取用户资料 users.profile.get
User 用户 Get User's Status 获取用户状态 users.getPresence
User 用户 Update User's Profile 更新用户资料 users.profile.set
User Group 用户组 Create 创建 usergroups.create
User Group 用户组 Disable 禁用 usergroups.disable
User Group 用户组 Enable 启用 usergroups.enable
User Group 用户组 Get Many 获取多个 usergroups.list
User Group 用户组 Update 更新 usergroups.update

如果不支持您的操作该怎么办#

如果此节点不支持您想要执行的操作,您可以使用 HTTP 请求节点来调用服务的 API。

您可以在 HTTP 请求节点中使用为此服务创建的凭据:

  1. 在 HTTP 请求节点中,选择身份验证 > 预定义凭据类型
  2. 选择您要连接的服务。
  3. 选择您的凭据。

有关更多信息,请参阅自定义 API 操作