• Ruediger
    link
    fedilink
    Deutsch
    arrow-up
    7
    arrow-down
    2
    ·
    1 day ago

    There is a api for banning him?

    • Draconic NEO@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      9
      arrow-down
      2
      ·
      edit-2
      19 hours ago

      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.

      • Ruediger
        link
        fedilink
        Deutsch
        arrow-up
        8
        arrow-down
        1
        ·
        17 hours ago

        Thanks for the explanation, this is a interesting tool, what i don’t understand is why its not just in the ui, but i don’t think you know that either.

        • Draconic NEO@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          8
          arrow-down
          1
          ·
          16 hours ago

          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.