Skip to content
This repository was archived by the owner on Sep 8, 2024. It is now read-only.

Latest commit

 

History

History
233 lines (177 loc) · 3.91 KB

File metadata and controls

233 lines (177 loc) · 3.91 KB

waitlistban Endpoint

The waitlistban endpoint retrieves a list of active waitlist bans, adds a waitlistban or deletes a waitlistban depending on HTTP method.

Note: You need to have sufficient permissions in the room to access this resource, otherwise you'll just be greeted with a requestError status. The required permission for fetching is Manager (role 3), required permission for banning is Bouncer (role 2) unless you are permanently banning then you need Manager (role 3), required permission for deleting is Manager (role 3)

Reason: The reason member is set as a single number which represent the following reasons:

1: Spamming or trolling.

2: Verbal abuse or offensive languages.

3: Playing offensive videos/songs.

4: Repeatedly playing inappropiate genres.

5: Negative attitude.

WaitlistBanDuration: The duration member can have the following values:

f: User is banned permanently

l: User is banned for a day

m: User is banned for an hour

s: User is banned for 15 minutes

More ban information here.

Endpoint

booth/waitlistban

booth/waitlistban/:userID

Method

POST, GET, DELETE

Parameters for POST

userID: ID of the user you want to move

reason: The reason why the user got banned

duration: The duration of the ban

{
    "userID": -1,
    "reason": 1,
    "duration": "x"
}

Possible error messages for POST

Insufficient permissions

{
    "data": [
        "You are not authorized to access this resource."
    ],
    "status": "notAuthorized",
}

Wrong userID

{
    "data": [],
    "status": "requestError",
}

Wrong duration time

{
    "data": [
        "Not a valid ban duration"
    ],
    "status": "requestError",
}

Wrong reason

{
    "data": [
        "Not a valid ban reason"
    ],
    "status": "requestError",
}

Not in a room

{
    "data": [
        "Not in a room"
    ],
    "status": "requestError",
}

Trying to permaban as bouncer

{
    "data": [
        "Nice try buddy, bouncers can't perm ban"
    ],
    "status": "requestError",
}

Trying to ban an admin/BA

{
    "data": [
        "That user is too powerful to ban"
    ],
    "status": "requestError",
}

Trying to ban someone higher ranked than you

{
    "data": [
        "Cannot ban a >= ranking user"
    ],
    "status": "requestError",
}

Trying to ban as user

{
    "data": [
        "Not a moderator"
    ],
    "status": "requestError",
}

reason or userID is missing

{
    "data": [
        "xxxxxxxx is required"
    ],
    "status": "requestError",
}

Data returned for POST

{
    'data': [],
    'meta': {},
    'status': 'ok',
    'time': 'xx.xxxxxxxxxxx'
}

Possible error messages for GET

Insufficient permissions

{
    "data": [
        "You are not authorized to access this resource."
    ],
    "status": "notAuthorized",
}

Data returned for GET

{
    'data': [{                  // Contains the requested data
        'duration': 'x',        // See WaitlistBanDuration above
        'moderator': 'xxxx',    // Name of the moderator
        'reason': 1,            // Reason why they got banned. See BanReason above
        'id': -1,               // ID of the user
        'timestamp': 'xxx',     // Date when the ban became active
        'username': 'xxxx'      // Name of the user
    }],
    'meta': {},
    'status': 'ok',
    'time': 'xx.xxxxxxxxxxx'
}

Parameters for DELETE

userID: ID of the user you want to unban

Possible error messages for DELETE

Insufficient permissions

{
    "data": [
        "You are not authorized to access this resource."
    ],
    "status": "notAuthorized",
}

Data returned for DELETE

{
    'data': [],
    'meta': {},
    'status': 'ok',
    'time': 'xx.xxxxxxxxxxx'
}