nosedrum icon indicating copy to clipboard operation
nosedrum copied to clipboard

Attempting to register commands to more than one guild_id returns unexpected response

Open kshannoninnes opened this issue 1 year ago • 0 comments

Brought up by a discussion in DAPI discord, the docs show an example of registering a command via Nosedrum.Storage.Dispatcher.add_command/4. The way the docs show an example of this only works for a single guild id, and not a list of guild ids. When attempting to use it with a list of guild id's you get an unexpected response, causing issues with pattern matching.

At first I thought I made a mistake when adding the queue_command functionality, but it seems the code that add_command call hits is unrelated. Specifically https://github.com/jchristgit/nosedrum/blob/e4be492af49ce72647543b286ba173da9a63c374/lib/nosedrum/storage/dispatcher.ex#L91

This handle_call overload returns [error_list, response_list], instead of the standard {:ok, res}. I believe this is the correct way of doing things and the docs could simply use an update. Unfortunately this has also highlighted a feature mismatch between add_command and queue_command that I'll open another issue for as I think they're separate discussions.

kshannoninnes avatar May 04 '24 14:05 kshannoninnes