Skip to content

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

Description

@kshannoninnes

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

def handle_call({:add, payload, name, command, guild_id_list}, _from, commands)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions