Skip to content

Added app command fields#48

Merged
jchristgit merged 29 commits intojchristgit:masterfrom
polyjitter:feature/all_app_command_flags
Oct 25, 2025
Merged

Added app command fields#48
jchristgit merged 29 commits intojchristgit:masterfrom
polyjitter:feature/all_app_command_flags

Conversation

@polyjitter
Copy link
Contributor

@polyjitter polyjitter commented Aug 30, 2025

This PR adds the following application command fields, which were missing before:

  • nsfw?
  • integration_types?
  • contexts?

It also refactors build_payload to be more extensible and maintainable for any future API changes that may occur. This was a necessity to support the new fields.

A breaking change was made to improve default_member_permissions: permissions are now converted to bitset on the nosedrum end, so library users only need to pass a simple list of permissions atoms. This should be a better interface (and was done as a part of the abovementioned build_payload refactor).

If backwards-compatibility is desired, it should be trivial to introduce that.

After considerable testing, I was able to confirm that if a field isn't explicitly passed during creation or update, Discord WILL set it to the internal default, so I documented the defaults in the new documentation.

Finally, this PR does not include support for name and description localization; although I hope to add that, there's some gaps for it in nostrum. I'm working on filling that in before I make a PR for those.

Feel free to critique as needed 😊 Thank you!

@polyjitter
Copy link
Contributor Author

Oops, the removal of global handling was a last minute change. I'll fix that real quick.

@jchristgit jchristgit self-assigned this Sep 14, 2025
Copy link
Owner

@jchristgit jchristgit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, thank you for the PR!

A breaking change was made to improve default_member_permissions: permissions are now converted to bitset on the nosedrum end, so library users only need to pass a simple list of permissions atoms. This should be a better interface (and was done as a part of the abovementioned build_payload refactor).

If backwards-compatibility is desired, it should be trivial to introduce that.

Yes, let's please introduce backwards compatibility here. We can log a warning if this is passed and remove it completely from the documentation.

Other than that this looks good - thank you very much!

def contexts, do: [:guild, :private_channel, :bot_dms]
```
"""
@callback contexts() :: [:guild | :bot_dms | :private_channel]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure if Dialyzer will understand this as it's meant. I think right now it may be interpreted as an improper list with three elements. I think we should maybe move the atoms into a different @type context :: :bot_dms | :guild | :private_channel

def integration_types, do: [:guild_install, :user_install]
```
"""
@callback integration_types() :: [:guild_install | :user_install]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same topic as above here

Copy link
Owner

@jchristgit jchristgit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't see that you pushed new commits. Looks good to me. Thank you!

@jchristgit jchristgit merged commit 572287d into jchristgit:master Oct 25, 2025
11 checks passed
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

Successfully merging this pull request may close these issues.

2 participants