gizmo385 / discord.clj

A Clojure library for creating Discord bots
MIT License
45 stars 14 forks source link

Custom documentation "items" #16

Open Arteneko opened 5 years ago

Arteneko commented 5 years ago

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\"]}"
gizmo385 commented 5 years ago

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.

Arteneko commented 5 years ago

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

gizmo385 commented 5 years ago

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.

Arteneko commented 5 years ago

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.