Extend usage of slow mode to fight battle of "live chat"

I think I’d like to see something along these lines in the category settings:


I believe you can solve 1b by modifying the topics via the rails console. I tested locally to see if this works the way I expect but I still strongly suggest you test in a staging environment before attempting this on your live Discourse or wait for confirmation from someone on the Discourse team that this is a good solution. (And probably still test in staging even if they do.)

Assuming you are using a Linux server with a standard install, SSH or otherwise get to a shell on the server and use the following:

cd /var/discourse
./launcher enter app
rails c

Then in the resulting rails console:

Topic.where.not(archetype: "private_message").update_all(slow_mode_seconds: 120)

120 is the number of seconds before another post is allowed, so replace that as desired. If you also want to avoid setting this for certain categories, you can chain this with .where.not(category_id: n), e.g. to avoid setting slow mode for categories 3 and 4, you would modify the above like so:

Topic.where.not(archetype: "private_message").where.not(category_id: 3).where.not(category_id: 4).update_all(slow_mode_seconds: 120)

You can get the ID for a category by visiting the category in your browser and looking at the address bar to find something like “c/staff/3”

3 Likes