There are indeed API calls for banning users from communities. They’re not accessible in Lemmy-UI, they make you do it from a comment or post there, but you can do it from anywhere.
Here’s the API call you use to do it:
https://[instance url]/api/v3/community/ban_user
And the body data you need, as well as some auth data specific to your session or account login not included here:
`{“community_id”:[community ID],“person_id”:[User ID],“ban”:true,“remove_data”:false,“reason”:“[Ban reason]”}
You can get User ID from a DM with the person, and you can get community ID by editing your community settings and taking a look at the request in the network tab of your Browser Dev tools.
You can execute one of these by opening dev tools, going to Network tab, editing and saving community settings, then hit edit and resend request. Change the type from SET to POST then replace the API URL with the one here, and replace the body of the request with the one here with the data appropriately filled out, and when you hit send, it’ll ban the user from the community.
I highly recommend community mods use this technique to deal with known bad actors before they infiltrate your community. Obviously one can go overboard and use it too much, but there are plenty of times it’s best to stop them before they join your community rather than after.
I think they just haven’t implemented it in UI yet. It’s a similar story with adding moderators, you have to add and remove them from comments as well. Though unlike the ban function Moderator management has been integrated in the photon UI, an alternate UI for Lemmy. That one doesn’t have the ability to manage banned users and add bans for any user though, my guess is they just haven’t added it yet there either.
There are indeed API calls for banning users from communities. They’re not accessible in Lemmy-UI, they make you do it from a comment or post there, but you can do it from anywhere.
Here’s the API call you use to do it:
https://[instance url]/api/v3/community/ban_user
And the body data you need, as well as some auth data specific to your session or account login not included here: `{“community_id”:[community ID],“person_id”:[User ID],“ban”:true,“remove_data”:false,“reason”:“[Ban reason]”}
You can get User ID from a DM with the person, and you can get community ID by editing your community settings and taking a look at the request in the network tab of your Browser Dev tools.
You can execute one of these by opening dev tools, going to Network tab, editing and saving community settings, then hit edit and resend request. Change the type from
SET
toPOST
then replace the API URL with the one here, and replace the body of the request with the one here with the data appropriately filled out, and when you hit send, it’ll ban the user from the community.I highly recommend community mods use this technique to deal with known bad actors before they infiltrate your community. Obviously one can go overboard and use it too much, but there are plenty of times it’s best to stop them before they join your community rather than after.
deleted by creator
I think they just haven’t implemented it in UI yet. It’s a similar story with adding moderators, you have to add and remove them from comments as well. Though unlike the ban function Moderator management has been integrated in the photon UI, an alternate UI for Lemmy. That one doesn’t have the ability to manage banned users and add bans for any user though, my guess is they just haven’t added it yet there either.
deleted by creator
I also just created an issue for this feature in Photon’s github.
https://github.com/jonsjava/luti/tree/user-management