BanAsync sets me as banned when I'm not supposed to be?

Recently, I have been making an Admin Panel on Roblox. I have moved on to the Ban feature, which I used BanAsync for. I got into testing, and then banned myself for a period of time. It was going well, until I banned myself when it didn’t actually say I was banned.

I tried asking a friend to run this command: game.Players:UnbanAsync({UserIds = {3405341348}, ApplyToUniverse = true}) (It didn’t work)

I have also tried to contact roblox support which I went through 13 captchas just for it to give me an error.

I just don’t know why I cannot unban myself, when I clearly am banned. Hopefully I didn’t confuse you.


Okay. This can’t be real. Apparently when you ban yourself its impossible to reverse it???

You can try using the open cloud APIs to unban yourself.

If unbanning doesn’t immediately work, you can try banning yourself again with a short duration, or ban then unban.

Documentation:

Interesting, I’ve never heard of this method. I’ll try it out.

Yeah I’m pretty new to CloudAPI. I ran this but I got this error: Error: { errors: [ { message: ‘’, code: 0 } ] } (I assume I did something wrong with the path part)

const Axios = require("axios");

const sendRequest = async () => {
    try {
      const response = await Axios.post(
        "https://apis.roblox.com/cloud/v2/universes/6874857825/user-restrictions",
        {
          path: "universes/6874857825/user-restrictions/3405341348",
          updateTime: "2023-07-05T12:34:56Z",
          user: "users/3405341348",
          gameJoinRestriction: {
            active: false,
          },
        },
        {
          headers: {
            "x-api-key": "blocked",
          },
        }
      );
      console.log("Response:", response.data);
    } catch (error) {
      console.error("Error:", error.response ? error.response.data : error.message);
    }
  };
  
  sendRequest();

Yeah, there are a couple of issues in the code you provided:

  1. It should be a patch request, not a post request
  2. You shouldn’t be providing a path thing in the request - I suspect you were looking at the response example rather than the request example.
  3. Not sure if this is actually applicable for you, but make sure the x-api-key thing actually includes the api key and not “blocked” (I assume you just redacted it for this post!)

yo thank you so much

heres the code if anyone needs it

const axios = require('axios');

const apiKey = 'your api key'; 

const sendRequest = async () => {
    try {
        const response = await axios.patch(
            'https://apis.roblox.com/cloud/v2/universes/{universe id}/places/{player id}/user-restrictions/{user id to unban}',
            { 
                "updateTime": "2023-07-05T12:34:56Z", 
                "user": "users/{user id to unban}", 
                "gameJoinRestriction": {
                    "active": false 
                }
            },
            {
                headers: {
                    'x-api-key': apiKey,
                    'Content-Type': 'application/json'
                }
            }
        );
        console.log('Response:', response.data); 
    } catch (error) {
        if (error.response) {
            console.error('Error Response:', error.response.status, error.response.data);
        } else {
            console.error('Error:', error.message); 
        }
    }
};

sendRequest();

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.