I am writing a Ruby script to bulk suspend users (I would like to permanently block the users from our Discourse forum, and from discussions in this thread suspension seems like the best option).
When inspecting the users in the console by doing:
me = User.find_by_username_or_email('email@example.com')
I note that each user has the properties
suspended_till. They are set to
nil if the user is not suspended, otherwise they have a date and time. I assume that I can just create a new
DateTime object with the relevant dates and times and assign to these properties to suspend the users.
However, I cannot see any properties for the suspension reason or referencing the admin who instigated the suspension. Does anyone know where I can find those properties?
It’s probably also worthwhile asking - will this procedure I have outlined work?