Add slash commands - #2462
Conversation
|
@JSKitty added slash commands to Concord. Might be worth comparing notes. |
|
Aye aye, both Vector and Armada support this proposal: Bot Commands & Manifests: This is designed to port the vast majority of Discord-like Slash Command functionality to Nostr in a modular and cross-client standardised way, I also have plans to extend it with optional enhancements, like Discord and Telegram's "Components System" for building mini composable UIs. Highly encourage taking a look, I will probably propose this if we're fully happy with it. bot-manifests-demo.mp4 |
b8d3a7f to
8b7a8c7
Compare
|
Thanks guys! It would be nice to converge. I've read the spec, and the core behavior is pretty much the same, with only one critical difference (see below). Here are some things I don't like, just to get them out of the way:
I will admit that these are mostly nitpicks. The main gap is that the armada nip has no targeting. This is important both for users and for executors. For executors, the only affordance in armada's version for filtering messages is to subscribe to everything in a given context and filter by parsing the content (this is at least wasteful; in broadcast social media contexts this is prohibitively expensive). This PR allows the bot to publish a scope in its manifest (it only listens to a particular kind, certain authors, a particular room, on a certain relay), which allows the bot to maintain a much narrower filter without requiring users to publish a particular tag. Just as important, publishing command scope in a machine-readable way allows clients to hide or show commands depending on whether the event it's about to publish actually will match a command. This allows us to have different commands show up in different contexts. This could easily be added to Armada's NIP, but in any case would require an update to existing implementations. I'm not in a position to dictate anything here since I'm just starting my implementation, but given the limitations I've pointed out, would you all be willing to consider migrating to something more nostr-ish? |
f13a0df to
5fe478b
Compare
Fair enough, but we are using Nostr, a protocol based on JSON. If it were my decision, the protocol wouldn't use JSON at all haha, I prefer minimal compact binary constructs.
Improvements are welcome! My clanky wrote the documentation, I was more focused on the functionality itself, which is now deeply proven in multiple clients and loved by many users, used by many bots, etc.
By integrating the Metadata NIP's I do not believe a regular (non-bot) account should be permitted to use Bot Manifests, this would be a serious vulnerability enabling deeper phishing possibilities, as well as presenting a generally awful and confusing UX. Users would not know what is truly a Bot or simply scam/spam accounts submitting manifests that look like a genuine bot. By forcing bots to use the bot tag, clients can at least display a clear distinction between "Humans" and "Bots" for the vast amount of circumstances.
This is true, and something I've planned as a future addition for our spec, but this can be added to the existing spec. The current spec is based on "public-yet-space-scoped commands", but ideally, some kind of bi-directional commands negotiation could be added which allows bots to return specific commands and parameters / options / choices based on specific circumstances (perhaps using a Bot Command in the context of a
This is interesting, I suppose there's no real issue with adopting your approach with putting bot pubkeys in-command when a targeted command is necessary. I think this should remain optional, as not every context requires stuffing a bot's npub within the text (in DMs or in certain Communities).
In the current usage of our spec, this is by design (it's mainly used in encrypted communities/groups, where there is no relay-level filtering of commands), but for fully public plaintext commands, I can see your point, I think we can extend the spec to fully support relay-level scoping and filtering, then we have a single unified framework for bots across all communications NIPs, very ideal! 🙏 |
| Commands should be published to relays where they can be discovered by the relevant users: | ||
|
|
||
| - For commands related to relays-as-groups or nip29 groups, commands should be published to the group relay | ||
| - For commands related to broadcast social media use cases, commands should be published to author outboxes and optionally command-specific indexing relays |
There was a problem hiding this comment.
Don't you mean the inboxes of the service provider?
There was a problem hiding this comment.
No, but I should clarify this. By command I mean command definition, so outbox. But invocations should go to the executor's inbox.
|
This is great. |
5fe478b to
7fbcbc9
Compare
No description provided.