Kayfarik Docs
Invite the BotSupport Server
  • Introduction
  • Common Problems
  • Permissions
  • Role Menus
    • Categories
    • Roles
  • Guides
    • How to Mention or Paste Server Emojis in Modals
    • Parsing Role Options
  • API
    • Parsing Role Options on Request
  • Links
    • Crowdin Translation Project
    • For Suggestions
    • Terms of Service
    • Privacy Policy
Powered by GitBook
On this page
  1. Guides

Parsing Role Options

/category-advanced parse-options-http

base-link: Link to the raw JSON or API that returns a valid JSON. If there are several pages, provide a link without a page number at the end.

array-name: The name of the array if it's an object, or [] if it's just an array.

option-name-key: An element key of role name.

option-id-key: An element key of role ID (don't specify if you're using role-determination option).

option-additional-key: An element key of the additional info to display as option's description.

Example Object

Command options in this example:

array-name: roles

option-name-key: name

option-id-key: id

roles.json
{
    "roles": [
        { "name": "Test Role 1", "id": "1092819232623964220" },
        { "name": "Test Role 2", "id": "1093119385926897696" },
        { "name": "Test Role 3", "id": "1092826062720872558" }
    ],
    "page": 1
}

Example Array

Command options in this example:

array-name: []

option-name-key: roleName

option-additional-key: info

roles.json
[
    { "roleName": "Test Role 1", "info": "Role Description 1" },
    { "roleName": "Test Role 2", "info": "Role Description 2" },
    { "roleName": "Test Role 3", "info": "Role Description 3" }
]
/category-advanced parse-options-html

base-link: Link for parsing elements. If there are several pages, provide a link without a page number at the end.

role-determination: The way to define roles from elements, i.e. compare element title and role name.

element-additional-queryselector: Additional info to display as option's description.

How to get element's class or ID

  1. Open Developer Tools:

For Chrome:

Right-click an element and select "Inspect Element".

For Microsoft Edge or Firefox:

Press F12 or Ctrl+Shift+I on the keyboard and find the elements.

  1. Hover over one of the elements in the panel, it should be highlighted:

  1. Copy what's after class= or id=

After a successful update of the category, provided parsing settings will be assigned to this category. Synchronize context-menu command will update the options using the saved settings.

Synchronization on Request (API)

Once you've assigned parsing settings within a category, you can use synchronization via the API or using the context menu.

PreviousHow to Mention or Paste Server Emojis in ModalsNextParsing Role Options on Request

Last updated 1 year ago

element-query-selector: of the element (role option). Use . at the start for class, and # for ID. Example: .element

element-title-query-selector: of the element's title (role option's label). Example: .title

CSS selector
CSS selector
Parsing Role Options on Request