Custom actions: Allow regex groups to be used in commands #16

Open
opened 2023-06-13 09:06:28 +01:00 by forquare · 0 comments
forquare commented 2023-06-13 09:06:28 +01:00 (Migrated from github.com)

Given a pattern, something like ^set time to (?P<time>.*), allow the admin to use the group in a command. Something like:

custom_actions:
  - name: "Set the server time"
    description: "Allows users to set the server time"
    pattern: "^set time to (?P<TIME>.*)"
    commands:
      - "time set <TIME>"

So if a player in Minecraft said set time to day, then Manaha Minder would send the server command \time set day.

NOTES:
Not sure if names groups like I mentioned above would be easiest, or positional matches like \1, \5, etc...

Given a pattern, something like `^set time to (?P<time>.*)`, allow the admin to use the group in a command. Something like: ```yaml custom_actions: - name: "Set the server time" description: "Allows users to set the server time" pattern: "^set time to (?P<TIME>.*)" commands: - "time set <TIME>" ``` So if a player in Minecraft said `set time to day`, then Manaha Minder would send the server command `\time set day`. NOTES: Not sure if _names groups_ like I mentioned above would be easiest, or positional matches like `\1`, `\5`, etc...
Sign in to join this conversation.
No description provided.