Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commands as buttons and/or keybindings #236

Open
davidschlangen opened this issue Jan 10, 2022 · 1 comment
Open

commands as buttons and/or keybindings #236

davidschlangen opened this issue Jan 10, 2022 · 1 comment

Comments

@davidschlangen
Copy link
Contributor

Feature request: For each slash-command (or a selectable subset), also create a keybinding (e.g., control-B) and / or a click-able button. (Where the button alternatively can be permanently located in the display area, or created in the chat area as something that scrolls up with the dialogue context.)

To give an example, in MapWorld games, I could imagine the game master (bot) producing text like "You can go east [type /e or control-< ] or west [ type /w or control-> ].", which is followed by little clickable buttons ⬅️ ➡️ in the chat area.

@wencke-lm
Copy link
Contributor

Regarding buttons. Though not yet possible automatically, for now there are two ways to include buttons.

  1. Bots when given the permission send_html_message can include buttons in their messages.
self.sio.emit(
    "text",
    {
        "message": "Please klick <button onclick=\"submit_command('ready')\">Ready</button> to begin the game.",
        "room": room_id,
        "html": True
    }
)
  1. Buttons can be included permanently in the display area, by inserting a respective html element into the room layout.
    An example of a bot working with those buttons can be found here: https://github.com/clp-research/slurk-bots/tree/master/boxbot
{
    "layout-type": "button",
    "layout-content": "Ready",
    "onclick": "submit_command(\"ready\");"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants