gizmo385/discord.clj

Custom documentation "items"

Opened this issue · 4 comments

I have a custom handler that handles a set of "formats".

I'd like to document them.

In bot.clj I found about register-extension-docs!, which seems to be for this exact purpose, but... How do one actually use it?

I tried a primitive code with typings as (register-extension-docs! "" "") (with actual values), but I get a HTTP 400 error, with the following body:

:body "{\"embed\": [\"fields\"]}"

The current use register-extension-docs! is inside of the defextension macro. It takes the keyword of the extension name as the argument and a string for documentation as the second argument.

If you're trying to add documentation to one of your extensions, that is something that is supported by the defextension macro and you could add the documentation for the formats there. See the admin extension as an example where both the extension and the subcommands within the extension are documented.

I'm building a raw message handler, and not an extension, is that still applicable?

Ahhhh I see. Raw message handlers aren't integrated into the documentation system in the same way that extensions and commands are. Changes could be made to include those in the documentation, but since they aren't invoked in the same way that extensions/commands are, it might be prudent do separate them from the standard documentation in the output.

Having a way to add some content to embed to the help embed would be nice, especially if it's a custom "command" filter, which would just add some "commands" or keywords.