删除未回复主题插件

The Delete Unreplied Topics plugin scans designated categories for topics that exist over x days which did not get any replies, and deletes them. This keeps your forum clean of topics that did not gain any traction for whatever reason.

Settings:

  • delete_unreplied_topics_categories the categories to work on
  • delete_unreplied_topics_days the amount of days before a topic without any posts will be deleted
  • delete_unreplied_topics_dry_run a safety net to test and make sure the plugin will not delete unwanted parts of your forum

The plugin logs its actions in /logs.

The repository can be found here.

This work has been sponsored by @outofthebox.

14 个赞

Amazing work @RGJ! Your skillful development of this plugin is a huge time saver and greatly improves our community.

8 个赞

Thank you for writing this.

It would be good if it would log the topic title as well as ID (DeleteUnrepliedTopics removing Topic ID #{t.id}).

And it would be more reassuring if delete_unreplied_topics_dry_run would default to true :slight_smile:

2 个赞

Thank you, those are very useful suggestions. I have made those changes.

5 个赞

I finally installed this plugin, so far in dry run mode. It seems correctly to identify the topics to delete.

In the logs each line like DeleteUnrepliedTopics would remove Topic ID *number* (*topic title*) (dry run mode) is preceded by the X indicator for an “Error”. I’d have expected it be “Info” or even “Warning”.

@RGJ Is that expected? Thanks. I’m using the latest version of Discourse.

1 个赞

Yes, that seems to be by design. I vaguely remember that there was some issue with debug levels so I made it to be an error. Sorry for any confusion!

4 个赞

Thanks for clarifying that. The plugin works as expected, thanks - though, interestingly, unlisted topics are displayed by Discourse as having at least one reply (i.e. the act of unlisting) which means your plugin does not delete them.

1 个赞

我刚注意到您的插件也不能删除置顶主题,因为置顶主题的行为被视为回复。这恰好是一件好事。

2 个赞


您知道为什么会出现这些错误消息吗?

启用此功能后,插件将仅记录其操作,而不会实际执行它们。

2 个赞

你好,
这个插件似乎正是我想要的,但我有点担心安装它,因为存储库已经有 4 年没有活动了。
你认为它应该仍然适用于当前的 Discourse 版本,还是可能会破坏任何东西?

1 个赞

写得非常好 :sunglasses:

而且这是一个非常特别的插件。我 99.9% 确定它仍然可以正常工作。
如果您愿意,可以先将其设置为“试运行”,这样就不会破坏任何东西。

4 个赞

好的。感谢您的快速回复!

1 个赞

@RGJ 根据其他用户的多项请求:

您能否将您的插件用作新插件的基础,该插件可以删除特定类别中超过 N 天(由用户设置)的主题?

如果您的插件已经在扫描主题,是否可以设置一些规则,说明:
如果类别是 X,则扫描创建日期和当前日期超过 N 天的主题,如果是,则删除它们。

我不知道创建和更改插件的细节,但这将是一个很好的补充。

只需移除单行即可。(或者,显然,创建一个设置 max_replies,默认为 0,然后可以将其设置为 99999 来达到所需的效果)。

话虽如此,我很难想到这个功能的好用例。

3 个赞

我想到的一个用例可能是每月重置一个不相关的休息室。也许是为了发泄情绪的自由竞争。

除此之外,我也想不到多少用例。另外,目前我认为它只能手动操作,除非可以进行自动化。是否可以简单地应用主题计时器并删除功能?我不记得它是否提供了删除主题的选项,还是只能删除回复。

1 个赞

这里有一个关于不同情况的讨论:

就我个人的情况而言(与上述主题中的一位用户类似),我希望有一个名为“分类广告”的类别,供音乐人使用(例如,歌手想找制作人,反之亦然),但我不想让主题永远可用,或者仅仅通过添加新回复来续订。我想设置一个计时器,例如,该类别中所有 2 周前的主题都将被删除,无论是否有回复。这样,用户就知道他们需要创建一个新主题,而不是仅仅添加一个无意义的回复,比如一个表情符号,否则主题将被 1 个表情符号回复填满,这看起来很糟糕。这也迫使用户,如果他们真的想找人合作,就努力创建新主题。这在某种程度上可以筛选掉那些懒得创建新主题、将文本保存在电脑或手机上等的人。

希望这有道理?

那么,如果这确实变成了一个插件,而我正在使用 Communiteq 进行托管,我需要选择哪个套餐才能安装该插件?

您可以为主题设置自动关闭吗?

那将是专业计划。

2 个赞

这不如您的插件有效,因为它允许旧主题在不再有效时可见。为什么我要看三年前寻找音乐人的帖子?我希望它们被删除。

另外,关闭主题与您的插件相同:它取决于回复,而这正是我不想要的。正如我提到的,这很容易导致用户仅仅添加表情符号类型的评论来让主题保持活跃。

我基本上只希望主题在 N 天/周后被删除,无论如何。正如您从我分享的主题中看到的,其他用户也有同样的需求。由于您的插件已经在做类似的事情,我认为创建一个无论回复如何都可以删除的版本应该不是什么大问题,每个管理员都可以根据自己的需求为他们的论坛选择他们想要的东西。

顺便说一句,你的问题问错了。你想要的东西完全不相关。用户想要的东西才是相关的。而且帖子又不花钱。

1 个赞