Structure of a custom JSON menu in MyChat
Example of a working menu:
{
"rootname": "Links",
"rooticon": 196,
"items": 11,
"item1": {
"name": "Sales requests",
"icon": 173,
"type": "open-link",
"data": "https://mycompany.com/kanban/#project=74"
},
"item2": {
"type": "hr"
},
"item3": {
"name": "iOS bugs",
"icon": 173,
"type": "open-link",
"data": "https://mycompany.com/kanban/#project=48"
},
"item4": {
"name": "Android bugs",
"icon": 173,
"type": "open-link",
"data": "https://mycompany.com/kanban/#project=25"
},
"item5": {
"name": "Kanban bugs",
"icon": 173,
"type": "open-link",
"data": "https://mycompany.com/kanban/#project=3"
},
"item6": {
"name": "Blue flag (server script)",
"icon": 172,
"type": "server-script",
"data": "OpenPrivateSupport",
"params": "%username% :)"
},
"item7": {
"name": "Tree example"
},
"item8": {
"parent": "item7",
"name": "Red flag (action link)",
"icon": 177,
"type": "exec-action",
"data": "about",
"params": ""
},
"item9": {
"parent": "item7",
"name": "Pill icon (Open help topic)",
"icon": 185,
"type": "open-help",
"data": "mychatclientwindows"
},
"item10": {
"name": "Disabled item",
"enable": false
},
"item11": {
"name": "Open text file",
"type": "open-link",
"data": "F:\\Public\\docs\\guide for techs.txt"
}
}
Important Names of the parameters and their type must be specified in lowercase exactly as in the table below because it matters.
Mandatory items
Parameter |
Type |
Description |
rootname |
string |
string, name of the menu root element that will be visible in MyChat Client main menu; |
rooticon |
integer |
icon index in a ready list; |
items |
integer |
total number of menu items. They are titled as "item1", "item2", "item3", and so on. Numeration starts from 1, no gaps allowed. |
Nested items
All nested menu items have mandatory name "item" and number, for example, "item15". Order does not matter, you can list items as convenient for you. Just remember, that the number of items must not be less than it's specified in the parameter "items".
Parameter |
Type |
Description |
name |
string |
menu item name, text string; |
parent |
string |
if this parameter is absent, then menu item will be in the root section, if present, then specify parent section, for example, "item12"; |
icon |
integer |
icon index from a ready list; |
type |
string |
menu item type, possible variants:
|
data |
string |
content that work in a command:
|
params |
string |
|
enable |
boolean |
if "false", then menu item is displayed as inactive (disable) and it is not clickable. It is convenient when you need to temporarily forbid some item without removing it from a JSON file. |