MihirR
(Mihir)
21. Dezember 2024 um 16:14
1
Is there a way to assign mod status to multiple users at once, for example, by grouping users based on certain criteria? Let’s say, I want to assign mod status to all users with the @example.com email domain. Is it possible to perform bulk mod assignment in this manner?
Canapin
(Coin-coin le Canapin)
21. Dezember 2024 um 19:20
2
This is not possible from the interface as far as I know, but can be done using the API or a rails script.
How many users must you promote to moderators to justify using an automated task? Are you trying to build an army ?
2 „Gefällt mir“
MihirR
(Mihir)
21. Dezember 2024 um 19:22
3
Hahaha, no, I was just trying to test some scripts using mod status.
There was no occurrence of this in the Discourse API , so now would have to check it out manually.
Canapin
(Coin-coin le Canapin)
21. Dezember 2024 um 19:26
4
Rails scripts must certainly be done with caution, and many would say it’s better not to rely on this method to “do stuff” as it can easily go wrong.
That said, IF done with care, IF you know what you’re doing, it’s a powerful tool to do various bulk tasks.
Some scripts examples can be found there:
Below you will find a collection of bulk operations that can be initiated from the command line. You will need SSH access, so if you are a hosted customer, you will need to contact the Discourse team about running these commands.
Before working with the console it is extremely important that you have a recent backup. Mistakes can always happen!
First thing to do is enter your site’s container:
cd /var/discourse
./launcher enter app
Additional Guides:
Performing bulk actions a…
1 „Gefällt mir“
Canapin
(Coin-coin le Canapin)
21. Dezember 2024 um 19:28
5
This documentation is incomplete, and will likely always be. Almost every action on Discourse uses the API. If you’re not finding what you’re looking for here, the best is reverse-engineering the API. It’s quite easy to do:
Discourse is backed by a complete JSON api. Anything you can do on the site you can also do using the JSON api.
Many of the endpoints are properly documented in the discourse_api gem, however some endpoints lack documentation.
To determine how to do something with the JSON API here are some steps you can follow.
Example: recategorize a topic.
Go to a topic and start editing a category:
[image]
Open Chrome dev tools, switch to the Network tab, select XHR filter:
[image]
Perform the op…
2 „Gefällt mir“
MihirR
(Mihir)
21. Dezember 2024 um 19:32
6
Thanks for sharing! I’ve worked with Discourse APIs before, but now I’m testing them thoroughly to see what’s the best I can build from this.
3 „Gefällt mir“