Skip to content

Commit

Permalink
fix: copy flag values in commands, just to be sure
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftinv committed Nov 26, 2024
1 parent ccd89f0 commit 307a441
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions disnake/ext/commands/base_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,19 @@ def _ensure_assignment_on_copy(self, other: AppCommandT) -> AppCommandT:
):
other.body._default_member_permissions = self.body._default_member_permissions

# TODO: actually `copy` these objects
if (
self.body.integration_types != other.body.integration_types
and self.body.integration_types is not None # see above
):
other.body.integration_types = self.body.integration_types
other.body.integration_types = ApplicationIntegrationTypes._from_value(
self.body.integration_types.value
)

if (
self.body.contexts != other.body.contexts
and self.body.contexts is not None # see above
):
other.body.contexts = self.body.contexts
other.body.contexts = InteractionContextTypes._from_value(self.body.contexts.value)

try:
other.on_error = self.on_error
Expand Down

0 comments on commit 307a441

Please sign in to comment.