Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

Add a whois endpoint #5

Closed
wants to merge 5 commits into from
Closed

Conversation

puppy0cam
Copy link
Contributor

@puppy0cam puppy0cam commented Aug 6, 2020

This pull request is intended for a server-side implementation of necessary data for a whois command within the client.

Current draft of endpoint documentation:

Player Verification

This is where the client can retrieve the Discord identity of a player based on their Minecraft Name without initiating an auth code check.
This can be useful for debugging the current state of the user.

GET /player/{Player Name}

Possible Errors:

This endpoint finds the discord identity of a player.

Required Headers:

  1. Content-Type: application/json
  2. Authorization: <webserver token>
Attribute Type Description
Player Name string The Minecraft player name

The Player Name is the Minecraft player Name stripped of all the dashes. The server will provide
the following response if everything went alright, otherwise an error may occur.

Response Body

No Data - Response

The player does not exist

Attribute Type Description
player_type string Possible types are described below
  • "not_found": This player could not be found
  • "outdated_spec": special state indicating that the client must be updated
    in order to account for a change that is not backwards compatible.

Unlinked Player - Response

Attribute Type Description
player_id string The Minecraft UUID for the player
player_type string Will be "pending_auth" - An auth code has been generated for the player, however the code has not been submitted in Discord.

Valid Player - Response

The player exists, here is the linked account

Attribute Type Description
snowflake string The Discord snowflake (id) of the player
player_id string The Minecraft UUID for the player
player_type string Possible types are described below
  • "player": This is a regular player who is allowed on the server.
  • "alt": This is an alt account of a staff member
  • "banned": This person is banned from using the bot and auth server.

Errors

Missing Player Name Attribute

{
  "errcode": "NO_PLAYER_ID",
  "message": "There wasn't a player ID provided"
}

@dylhack dylhack self-requested a review August 6, 2020 07:43
@dylhack dylhack self-assigned this Aug 6, 2020
@dylhack dylhack added enhancement New feature or request good first issue Good for newcomers labels Aug 6, 2020
@puppy0cam
Copy link
Contributor Author

A potential option for preventing rate limits from being hit is to have the client limit permissions to the command be limited to staff. This would help ensure that a staff member can investigate a player easily without having to access discord.
This does not meet what my intention for use of the command should be as I think it would be ideal if regular players were permitted to use it to find the owner of a plot if they want to contact them for a merge or transfer. The fact that the discord command pings the target is not ideal for those purposes as they might decide otherwise upon finding the identity. It's also inconvenient, and knowledge of the discord command for this does not appear to be very prevalent.

@puppy0cam
Copy link
Contributor Author

This should be achievable by having the user copy text that will be interpreted as a @ mention for them by their Discord client. This will negate the need to lookup their user data from Discord itself
Tellraw data may look like so:

[
    {
        "text": "This user exists, click ",
        "color": "yellow"
    },
    {
        "text": "here",
        "bold": true,
        "color": "yellow",
        "clickEvent": {
            "action": "copy_to_clipboard",
            "value": "<@201600394353311744>"
        }
    },
    {
        "text": " to copy their username to mention them in Discord",
        "color": "yellow"
    }
]

@dylhack dylhack closed this Jan 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants