Web-API icon indicating copy to clipboard operation
Web-API copied to clipboard

Improve interactive messages : tooltips and new lines

Open oblx opened this issue 7 years ago • 0 comments

Tooltips would be really great to explain what options are about and we could add a simple argument :

{
    "id": "duel-choice",
    "target": "string",
    "uuid": "randomstring",
    "message": "How would like your duel flavored ?",
    "options": 
    [
        {
            "key": "duel-1-kill",
            "value": " [1 Kill]",
            "tooltip": "Duel is over after one reaches 1 kill"
        },
        {
            "key": "duel-5-kill",
            "value": " [5 Kills]",
            "tooltip": "Duel is over after one reaches 5 kills"
        },
        {
            "key": "duel-2-deaths",
            "value": " [2 deaths]",
            "tooltip": "Duel is over after one get killed :\n2 times"
        },
        {
            "key": "duel-cancel",
            "value": " [Cancel]",
            "tooltip": "Cancel this duel\n&cMake love not war"
        },
    ]
}

Maybe we could also improve the way options are displayed with \n, interactive, suffix and prefix. Similar to tooltips but in a different way :

"options": 
[

    {
        "interactive": "false",
        "value": "&f=============&6SEPARATOR&f=============",
        "suffix": "\n"
    },
    {
        "key": "answer-id-whatever",
        "prefix": "Sell it for $200",
        "value": "&a[Accept]",
        "suffix": "\n",
        "interactive": "true"
    },
    {
        "key": "answer-id-whatever",
        "prefix": "Sell it for $300",
        "value": "&c[Much better]",
        "interactive": "true"
    },
    {
        "interactive": "false",
        "value": "\n&f=============&6SEPARATOR&f=============",
    }
]

Would output in chat :

=============SEPARATOR=============
Sell it for $200 [Acceptable]
Sell it for $300 [Much better]
=============SEPARATOR=============

Just some random ideas 🤓

oblx avatar Jul 17 '18 13:07 oblx