Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle API Options Consistently #639

Open
kyleboe opened this issue Oct 25, 2024 · 0 comments
Open

Handle API Options Consistently #639

kyleboe opened this issue Oct 25, 2024 · 0 comments

Comments

@kyleboe
Copy link
Contributor

kyleboe commented Oct 25, 2024

On the Nostrum.Api module, currently the options type is simply defined as a map | list.

This does not provide much context for which keys/values are specifically required/optional and how they are typed.

With the upcoming decomposition of Nostrum.Api into submodules, this may be an appropriate location to define more structured types for option arguments. Something like this:

@type guild_member_options :: %{
          nick: Guild.Member.nick(),
          roles: [Snowflake.t()],
          mute: boolean,
          deaf: boolean,
          channel_id: Snowflake.t(),
          communication_disabled_until: DateTime.t() | nil
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant