-
Notifications
You must be signed in to change notification settings - Fork 424
MSC4391: Simplified in-room bot commands #4391
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
base: main
Are you sure you want to change the base?
MSC4391: Simplified in-room bot commands #4391
Conversation
Start off by incorporating MSC4332.
Not really needed when the command description state event is scoped by sender.
Even though the MSC is simpler, we're more ambitious and able to do more with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation requirements:
- Client
- Bot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gomuks/gomuks#675 is mostly complete implementation of client and technically also bot, converted from MSC4332. It doesn't have full support for room/event IDs or unions yet, but mostly it should be there
It assumes most of my suggestions in other comments are applied. Specifically:
commandstring instead ofdesignatorarray"optional": trueinstead of"required": false- primitive schemas nested in an object with
"schema_type": "primitive" - arrays only at top level and unions only at top level or in arrays)
- optionally: list of
aliases,default_valuefor default values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(all of these suggestions were up-streamed into the MSC)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proper bot implementation: maunium/meowlnir#50
Both meowlnir and parts of gomuks use logic from mautrix/go#446 (gomuks web has its own typescript implementation, gomuks terminal uses mautrix-go)
| "m.text": [{ "body": "Whether to apply this to the policy" }] | ||
| }, | ||
| // This argument is not required | ||
| "required": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an alternative/extension to optional parameters, a default value might be useful. The /raw command in gomuks has {} as the default value for event JSON for example
Also, "optional": true might be nicer than "required": false to allow treating undefined as false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't include defaults at this stage because they can also be provided by partial commands and interactive prompts ie the way suggestions work in draupnir. I guess it might be ok if it's treated like a literal default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little bit hesitant to do so right now and am thinking of making a JSON RPC style response follow up MSC that can explore the prompts and partial commands before settling on how to do defaults.
matrix-org#4391 (comment) Co-authored-by: Tulir Asokan <[email protected]>
matrix-org#4391 (comment) Co-authored-by: Tulir Asokan <[email protected]>
Enable ease of parsing matrix-org#4391 (comment) Co-authored-by: Tulir Asokan <[email protected]>
matrix-org#4391 (comment) Co-authored-by: Tulir Asokan <[email protected]>
matrix-org#4391 (comment) Co-authored-by: Tulir Asokan <[email protected]>
Co-authored-by: Tulir Asokan <[email protected]>
Co-authored-by: Tulir Asokan <[email protected]>
Co-authored-by: Tulir Asokan <[email protected]>
Rendered
Signed-off-by: Gnuxie [email protected]
This MSC incorporates work from MSC4332