discord.clj icon indicating copy to clipboard operation
discord.clj copied to clipboard

Custom documentation "items"

Open Arteneko opened this issue 5 years ago • 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\"]}"

Arteneko avatar Aug 29 '19 23:08 Arteneko

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.

gizmo385 avatar Sep 02 '19 17:09 gizmo385

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

Arteneko avatar Sep 02 '19 18:09 Arteneko

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.

gizmo385 avatar Sep 03 '19 04:09 gizmo385

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.

Arteneko avatar Sep 03 '19 06:09 Arteneko