# 无法删除此类别，因为它包含聊天频道

**URL:** https://meta.discourse.org/t/cant-delete-this-category-because-it-has-chat-channels/238432
**Category:** Support
**Tags:** chat
**Created:** [2022年九月8日 09:19 UTC](https://meta.discourse.org/t/cant-delete-this-category-because-it-has-chat-channels/238432 "2022-09-08T09:19:52Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Byungjun](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/byungjun/32/273298_2.png) [@Byungjun](https://meta.discourse.org/u/Byungjun)
#### Post date: [2022年九月8日 09:19 UTC](https://meta.discourse.org/t/cant-delete-this-category-because-it-has-chat-channels/238432/1 "2022-09-08T09:19:52Z")

</div>

我想删除默认类别“site-feedback”、“staff”。  
但无法删除。错误消息显示“无法删除此类别，因为它包含聊天频道。”

有什么办法可以删除这些类别吗？

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2022年九月8日 10:13 UTC](https://meta.discourse.org/t/cant-delete-this-category-because-it-has-chat-channels/238432/2 "2022-09-08T10:13:31Z")

</div>

您想删除 `#staff` 类别是出于什么原因？默认情况下，它仅对管理员和版主可见，并且 FAQ、隐私政策和 ToS 的基础主题（以及管理员指南）都位于其中。

不过，一般来说，您可以删除任何没有主题或聊天频道附加的类别。如果存在任何内容，您需要重新分类任何主题并删除任何聊天频道，然后才能删除类别本身。👍

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [2022年九月8日 10:24 UTC](https://meta.discourse.org/t/cant-delete-this-category-because-it-has-chat-channels/238432/3 "2022-09-08T10:24:09Z")

</div>

~~删除默认（预填充）数据是个坏主意。您提到的两个类别都是预填充的。这会增加您的 discourse 因数据库损坏（缺少其期望的值等）而随机中断的风险，因此请谨慎操作。除非您已经知道自己在驶入未知水域。~~

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2022年九月8日 10:38 UTC](https://meta.discourse.org/t/cant-delete-this-category-because-it-has-chat-channels/238432/4 "2022-09-08T10:38:52Z")

</div>

我认为删除 `#contribute:site-feedback` 和 `#lounge` 通常是被允许的。不建议删除 `#staff`，因为它包含了我上面提到的那些主题（而且保留它很有用）。不过，我相信删除这些主题不会导致数据库损坏，但如果你能提供一些反例，我很乐意被纠正。如果这些主题真的不应该被删除，那么界面应该会阻止你执行删除操作（就像“关于”主题那样）。

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [2022年九月8日 10:43 UTC](https://meta.discourse.org/t/cant-delete-this-category-because-it-has-chat-channels/238432/5 "2022-09-08T10:43:55Z")

</div>

好的，我可能过去误读了某些内容（或者纯粹是迷信）。根据

> [@Ok to delete default categories?](https://meta.discourse.org/t/ok-to-delete-default-categories/36672/2?u=itsbhanusharma):
>
> Deleting them is totally safe, mucking with Lounge permissions is definitely not.

删除预种子类别是安全的。

---

<div class="post-metadata">

### Author: ![Byungjun](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/byungjun/32/273298_2.png) [@Byungjun](https://meta.discourse.org/u/Byungjun)
#### Post date: [2022年九月8日 11:10 UTC](https://meta.discourse.org/t/cant-delete-this-category-because-it-has-chat-channels/238432/6 "2022-09-08T11:10:39Z")

</div>

谢谢！

如果我没有打扰您的话……🙏🏻  
您能更具体地告诉我如何重新分类任何主题和删除任何聊天频道吗？

我在管理员模式下找不到菜单😭

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2022年九月8日 11:35 UTC](https://meta.discourse.org/t/cant-delete-this-category-because-it-has-chat-channels/238432/7 "2022-09-08T11:35:57Z")

</div>

我想，如果您刚开始探索 Discourse，我建议您暂时不要删除任何预设的分类，也不要移动任何关于常见问题解答、隐私政策或服务条款的主题，直到您更熟悉各项功能为止。🙂

在此期间，您可以将 `#contribute:site-feedback` 的可见性设置为仅管理员可见，这样它就不会向公众显示。以未登录状态或您创建的测试用户身份查看您的站点，是一种了解普通访问者和用户会看到的内容的好方法（这与“管理员能看到一切”的视图不同）。

您可以在以下主题中了解更多关于分类权限的信息：

> [@理解群组和类别权限](https://meta.discourse.org/t/how-to-create-private-categories-using-category-permission-security-settings/87678):
>
> bookmark 本指南介绍如何使用 Discourse 中的群组来管理类别可见性和用户权限。 person_raising_hand 所需用户级别：管理员 群组和类别权限对于管理 Discourse 社区内的访问和内容创建至关重要。本指南将帮助您了解如何有效使用这些功能。 摘要 类别权限控制可见性和用户操作 权限通过群组访问列表进行管理 不同权限级别：查看 (See)、回复 (Reply) 和创建 (Create) 关于管理员、版主和匿名访问的特殊注意事项 管理类别权限 访问类别安全设置 导航到您要管理的类别 选择带有扳手图标的“编辑类别”按钮 转到“安全”选项卡 理解权限级别 您可以分配给群组的权限有三个级别： 查看 (See)：用户可以查看类别及其内容 回复 (Reply)：用户可以在现有主题中发表回复 创建 (Create)：用户可以在类别中创建新主题 将群组添加到访问列表 点击“添加群组”按钮 从下拉菜单中选择一个群组 为该群组选择适…

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [2022年九月8日 11:45 UTC](https://meta.discourse.org/t/cant-delete-this-category-because-it-has-chat-channels/238432/8 "2022-09-08T11:45:35Z")

</div>

这里有点麻烦，因为我们可能正在为这些类别预设聊天频道，即使聊天功能并未启用。

您可能需要暂时在您的站点设置中启用聊天功能，以便找到这些频道进行删除。

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [2022年十一月8日 14:35 UTC](https://meta.discourse.org/t/cant-delete-this-category-because-it-has-chat-channels/238432/10 "2022-11-08T14:35:04Z")

</div>

👋

@loic 合并了一个针对此问题的修复程序，请告知我们您的使用情况。

> <https://github.com/discourse/discourse/pull/18865>
>
> Currently it’s not possible to delete a category if an associated chat channel i…s present even if there are no messages in this channel. This can lead to annoying situations for our users.
> 
> This PR addresses the issue by checking if the channel is empty instead of just checking if there is a channel.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [2022年十一月10日 14:35 UTC](https://meta.discourse.org/t/cant-delete-this-category-because-it-has-chat-channels/238432/11 "2022-11-10T14:35:31Z")

</div>

该主题在上次回复后 2 天自动关闭。不再允许新回复。
