Args Parser

The Args Parser endpoint lets you send a text string and get back arguments and extra details based on the query parameters. It's handy for tasks like text manipulation, extracting user IDs, and checking for specific text in commands.

Endpoint

  • URL: https://api.erensko.xyz/v1/parse-args

  • Method: POST

  • Description: Splits the provided text into arguments and returns additional info like whether it contains time or reason details.

Request Body

  • text (required):

  • Type: String

  • Description: The text string to be processed.

Query Parameters

Key
Value

pingtoid (optional)

If set to true, user mentions in the form <@ID> are converted to just the numerical ID.

textstatus (optional)

If set to true, checks the text arguments for time (like "7d", "3w", etc.) and reasons, and provides the structure.

Headers

Key
Value

Authorization

Your own personal API key, create one by clicking here. This is required.

Request Example

POST https://api.erensko.xyz/v1/parse-args

{
  "text": "?ban <@407342486713794562> 7d Spamming"
}

Response Example

This is a response with the ?pingtoid=true parameter.

{
  "arg1": "?ban",
  "arg2": "407342486713794562",
  "arg3": "7d",
  "arg4": "Spamming",
  "hasTime": true,
  "hasReason": true,
  "structure": "All Exist"
}

Text Status

  • hasTime: A boolean indicating if a time pattern (e.g., "7d", "3w") is present in the arguments.

  • hasReason: A boolean indicating if any reason is provided after the time argument.

  • structure: Describes the overall structure of the text. Possible values:

    • "All Exist": Both time and reason exist.

    • "No Reason": Only time is present, with no reason.

    • "No Time": A reason is present, but no time is detected.

    • "No Time No Reason": Neither time nor reason is present.

Last updated