Discourse 自动化

:discourse2: 摘要 Discourse 自动化允许您通过脚本和触发器自动执行操作。自定义功能通过自动生成的用户界面实现。
:open_book: 安装指南 该插件已随 Discourse 核心 bundled。无需单独安装该插件。

功能

  • 轻松自动化复杂工作流
  • 在特定日期、定期或特定事件时触发自动化
  • 提供自动生成的用户界面,用于指定您的自动化选项

配置

自动化可以从“管理” → “插件” → “自动化”创建和更新,也可以直接从 /admin/plugins/discourse-automation 进行。

可用脚本

指南 脚本 触发器 描述
:bookmark: 通过自定义字段将用户添加到组 :black_small_square:定期\u003cbr\u003e:black_small_square:首次登录 根据自定义用户字段将用户添加到组
:bookmark: 追加最后检查者 :black_small_square:帖子渲染后 在原始帖子(OP)底部添加“最后检查者”功能
:bookmark: 追加最后编辑者 :black_small_square:帖子渲染后 在原始帖子(OP)底部添加“最后编辑者”说明
:bookmark: 自动回复 :black_small_square:帖子编辑/创建\u003cbr\u003e:black_small_square:私信创建 根据一系列关键词及相关回复,自动回复相应的内容
自动标记主题 :black_small_square:帖子创建/编辑\u003cbr\u003e:black_small_square:私信创建 自动为主题添加标签
关闭主题 :black_small_square:特定时间点\u003cbr\u003e:black_small_square:停滞的维基 自动关闭主题
创建帖子 :black_small_square:定期\u003cbr\u003e:black_small_square:特定时间点 创建帖子
基于关键词标记帖子 :black_small_square:帖子编辑/创建 如果主题在创建或编辑时包含特定词语,则标记该主题
礼物交换 :black_small_square:特定时间点 简易版“神秘圣诞老人”游戏实现
组类别通知默认值 :black_small_square:类别创建/编辑 自动为新创建的子类别设置组通知级别
设为横幅主题 :black_small_square:特定时间点 将主题转换为横幅通知
置顶主题 :black_small_square:特定时间点 在未来置顶或取消置顶主题
随机分配\u003cbr\u003e(分配) :black_small_square:特定时间点\u003cbr\u003e:black_small_square:定期 随机分配主题
安排带有数据探索结果的私信\u003cbr\u003e(数据探索) :black_small_square:定期 发送包含数据探索查询结果的定期私信
发送聊天消息\u003cbr\u003e(聊天) :black_small_square:事件开始\u003cbr\u003e:black_small_square:定期 向频道发送聊天消息
发送私信 :black_small_square:首次接受解决方案 (已解决)\u003cbr\u003e:black_small_square:授予用户徽章\u003cbr\u003e:black_small_square:用户添加到组\u003cbr\u003e:black_small_square:停滞的维基\u003cbr\u003e:black_small_square:定期\u003cbr\u003e:black_small_square:用户晋升\u003cbr\u003e:black_small_square:API 调用\u003cbr\u003e:black_small_square:用户从组中移除 发送支持占位符的私信
按邮箱暂停用户 :black_small_square:API 调用 暂停用户指定时长
主题必需关键词 :black_small_square:主题 强制主题帖子中至少包含指定词语之一
:bookmark: 使用 AI 分类帖子 (Discourse AI) :black_small_square:帖子创建/编辑 通过自动化帖子分类流程,增强论坛帖子的管理和审核
用户全局通知 :black_small_square:停滞主题\u003cbr\u003e:black_small_square:首次接受解决方案 (已解决) 为特定用户在网站上显示全局通知
:bookmark: 通过徽章管理用户组成员资格 :black_small_square:定期\u003cbr\u003e:black_small_square:用户首次登录 根据用户获得的徽章自动将其添加到组中
Zapier 网络钩子 :black_small_square:用户晋升\u003cbr\u003e:black_small_square:用户添加到组\u003cbr\u003e:black_small_square:授予用户徽章\u003cbr\u003e:black_small_square:用户从组中移除 调用 Zapier 网络钩子

可用触发器

\u003e 请注意,由于其性质,每个脚本仅支持某些触发器。例如,强制帖子内容的脚本在用户被添加到组时触发是没有意义的。

所有可用触发器均在上方的“可用脚本”表中提及。

大多数触发器一目了然,但以下几项可能需要更多说明:

触发器 描述
帖子渲染后 在帖子渲染并准备显示后触发
API 调用 当调用特定 API 端点时触发
停滞的维基 当维基长时间未被编辑时触发
停滞的主题 当主题在特定时间内未收到回复时触发
主题 当对主题进行回复时触发

如果您需要任何其他触发器的澄清,请随时在下方提问。:slight_smile:

更多脚本和触发器即将推出!

自定义自动化

您还可以创建自定义自动化。:partying_face: 查看我们的开发者指南以获取更多信息 - Create custom Automations

\u003cbr\u003e

\u003e:discourse2: 由我们托管?此插件可在我们的商业版和企业版计划中使用。Automation | Discourse - Civilized Discussion

75 个赞
Are there any examples "in the wild" of interesting things the Discourse Automation plugin can do?
Creating bot on discourse
An 'add to group' script for the Discourse Automation
Sending a private message automatically to new users?
Trigger an email to all users periodically with a pre-defined message or link
Choose groups and watched categories on signup
Users self-select Category on Registration... is it possible?
Can discourse delete archived posts automatically and accept registration without email?
Ability to add multiple topic timers
Prevent users from moving topics in other categories
Webhook - TL Demotion
Add users to groups on signup
A Bot to match random users?
Discobot Type Message Automation
Future pin topics! (feature request)
Linked topics (splitting and managing megatopics)
When a thread is too important to lose
Welcome message
Creating an automated message upon successfully answering to a topic
Unlist or archive a post when it has no reply per category
Trust Level Wishlist Items
How to change owner of invite links?
Voting plugin requirements
No errors, instance not coming back up after rebuild
How to set a welcome email to be sent as soon as a user signs up?
Automatic Messaging
Can I send message to who had the special badge automatically?
How to integrate Discourse Gamification with an external system (redeem and award points)
Limiting Subscription Length
Teach Discobot?
Can watching a category watch all its subcategories as well?
Restricting users to join any one private group
Trust level freeze
Onboarding course?
Chat Auto-responder?
Endorsement Prompts
What if badges could optionally synchronize group membership?
Convert a category to private and add users to a specific group with access
Is there a component so when a topic is marked as Solved, the topic gets locked and a custom message is posted with it?
Setting up spam detection in your community
Creating a custom Automation
Exclude certain categories from the Trust Levels
Query to create some groups based on activity
500 error using automation plugin
Pie-in-the-sky idea: arbitrary automation scripts via docker image
How can I set up invites by members so admins control what invitees see?
Default Tag for specific Categories
How to respond to automatic topics with AI
Pin on certain days
Discourse AI - AI triage
Restrict users to post certain words per category
Plugin or other option to require a post and a like?
Gamification beyond Leaderboard
Configuring automatic post review triggers
Is it possible to moderate all personal messages sent between users?
Where would I find documentation on auto-bumping?
Alternative sign up pathways
A Plug-In to convert Discourse Forum Discussions into Clear Proposal Revisions with Community-Sourced Justifications
Bug Report: "Auto Tag Topic" in Discourse Automation — Link Detection Not Working, Onebox Triggers Image
Mandatory Topic Timers for all topics in a category
Can no longer create global banners from restricted categories
How to generate AI replies for forum topics using Persona
Discourse AI - AI triage using Agent
Is there a way to schedule the creation of a topic? And to schedule a reply to someone else's topic?
Is there a way to schedule the creation of a topic? And to schedule a reply to someone else's topic?
Topic ID as a variable?
Automation script: Move topic on close
Can I send an automated welcome message to all new users?
Allow bumping for topics with zero replies
Customizing trust level promotion messages for new users
Setting up automated admin notice alerts
Discourse AI - Periodic summary reports
Changing automated Personal Message text
Category Exclusion (Blacklist) for Automation Triggers
"Triage posts using AI" script of "Automation" plugin always includes image data in request
"Needs Approval" review items from “Triage posts using AI” script of “Automation” plugin not visible to moderators
Advice on a support forum
Welcome message
Setting up toxicity detection in your community
Automated tagging when topic is created
Discourse Chat Integration
Email-in Filtering or Multiple Emails per Category/Group
Unanswered topic notification
Autoresponder (after 15 minutes) when someone joins my discourse
2.8.0.beta3: User-selectable Avatar Flair, Last Topic Visit Indicator, Native File Picker, and more
Add timer to banner topics
Agree to additional terms before joining group
@ mentioning every community members
Reconciling Discourse Chat with other Community Chat Tools like Discord
Send Promotion PMs
Groups for Users
Bulk mark messages and posters as spam
How to automate messages
Automatically move topic category after topic close
Bringing Icebreakers into Discourse
How are `system_messages.welcome_user.*` values used?
Adding tags to topics created with Discourse Embed feature?
Discourse AI - Periodic summary reports
Automatically delete users flagged by system?
How to create autoresponder using automation
Select a group when registering?
Make topic a global banner for n period of time when created in a category
Group based on Custom Field
Looking for help posting automating data explorer reports to my forum
Automatically Assigning Titles Based on Trust Level in Discourse
Reply bot for Discourse?
PM auto responder
Has anyone created a custom Automation?
Create custom Automations
Has anyone experimented with using the usual "Lounge" category with trust level 2
How to schedule posts (not topics)?
Automate post creation on Discourse with multiple users
Customise text for TL3 promotion PM
Choose groups and watched categories on signup
Grant Badge when user visits link
Discourse Subscriptions with Thrive Cart
Can I send message to who had the special badge automatically?
Automatic and periodic PMs for new users
Invitation Links are Only Working for Non-existing Users & Breaking Our Current Implementation
Add members of trust_level_3 to another group and remove them once they lose the trust_level_3
Webhooks plugin
Registration for non-Facebook Users
Membership anniversary
How to add all members in a new group?
New user alerts
An 'add to group' script for the Discourse Automation
Daily Summary Feedback
Watched Words Reference Guide
Can a user block a user group?

请注意,我已在 OP 中添加了一个包含所有现有自动化及其触发器伴随的表格。:+1:

(我也希望添加更多指南,因为“将用户添加到组…”的指南独自看起来有点孤单 :slight_smile:


Setting up the ‘Append last edited by’ automationSetting up the 'Append last checked by' automation 添加了另外几个演练。:tada:

还有一个全新的脚本,通过徽章进行用户组管理:partying_face: 那个刚刚发布,所以如果你尝试一下,请告诉我们你的使用情况。:+1:

12 个赞

我现在感觉自己非常非常……不是说蠢,但差不多。我可以在哪里构建自动化?在插件下,我只能启用或禁用自动化。

3 个赞

启用插件后,您应该在此处看到新项目:

可能需要刷新页面才能看到它。

3 个赞

我现在觉得自己真是太蠢了 :man_facepalming:

谢谢。

1 个赞

我之前也卡在那儿过 :slight_smile:

这个主题的回复可能应该设置为30天后自动删除。至少这个回复应该。

2 个赞

我们不再为 official 插件主题这样做。太多的好信息已丢失给主题计时器。我们现在手动管理它们,并将任何重要的讨论分成单独的标记主题(并鼓励人们首先开始单独的主题)。:+1:

18 个赞

帖子已拆分为新主题:Automation to close Solved topics and post a template response

:information_source: Discourse Automation 已与 Discourse 核心捆绑在一起,因此不再需要单独安装此插件。 :partying_face:

:discourse2: 由我们托管?此更改不会以任何方式影响您。 :+1: 如果您使用的是 Business 或 Enterprise 套餐,您可以继续使用此插件,无需担心任何问题。

6 个赞

是否有可以更改类别的自动化脚本?我想用它来创建一个更灵活的“计划发布”系统。

我设想该脚本将

  • 定期运行,并
  • 检查给定类别中在回复中带有某种标记的主题(例如,“标记为已解决”或“回复包含特定文本,如‘发布’”)。
  • 如果该回复的日期(或“已解决”状态)比给定的偏移量(例如,昨天或一周)更早,
  • 删除所有回复
  • 移动到给定类别
  • 可选地,添加可配置的标签

一个更复杂的版本可能会查找触发回复中的日期/时间,并在当前时间晚于该日期/时间时发布。

它也可能查找该帖子中的目标类别(具有脚本配置允许的目标类别)。因此,标签也是如此。

3 个赞

这可以做到,但目前还没有这样的东西。

1 个赞

您好,我不明白这个触发器的用例。它似乎可以发送私人消息,但发送给谁呢?因为 Wiki 可以被多个用户编辑。谢谢。

您将在 UI 中决定谁将接收 PM。

1 个赞

有没有办法创建自定义脚本?

此主题是关于寻找一种方法来要求审核私人消息。

所以我想象的是

  • 触发创建私人消息
  • 自动标记以供审核。

我认为可以:

不过这需要一些开发技能。

4 个赞

这很酷。想象一下,主题中的 Op(我链接的)可能会考虑赞助一个脚本,这取决于他们对该功能的需求有多大。

感谢 Jammy 迅速回复。一如既往地知识渊博。

2 个赞

您好,我不明白这个是如何工作的。我有一个自定义用户字段,可以接受“是”或“否”(下拉列表)两个值。但是,在创建自动化时,只要求我输入自定义字段的名称,而不是其值。如果我无法测试自定义字段的值,我该如何触发自动化将此用户添加到组中?谢谢。

自定义字段的值必须与组名匹配。因此,如果你的问题是“你更喜欢什么?”而你的答案是“狗”和“猫”,那么组的完整名称必须是“狗”和“猫”。你不能称它们为“爱狗人士”和“爱猫人士”。

链接的指南中有一个提示

但我一开始也没明白。

1 个赞

好的,我现在明白了,所以我的用例是不可能的:拥有一个可以回答“是”或“否”的自定义字段,因为组名应该是“是”或“否”…… :roll_eyes:

1 个赞

我能否根据帖子或帖子标题中的关键字来“自动标记帖子”?看起来它只能根据组或类别自动标记内容,这在我的情况下不太有用。