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

Fix app command copies #678

Merged
merged 10 commits into from
Aug 25, 2022
1 change: 1 addition & 0 deletions changelog/678.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make the :func:`.ext.commands.default_member_permissions` decorator always work in cogs.
3 changes: 3 additions & 0 deletions disnake/ext/commands/base_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import datetime
import functools
from abc import ABC
from copy import copy
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union, cast

from disnake.app_commands import ApplicationCommand
Expand Down Expand Up @@ -202,6 +203,8 @@ def _ensure_assignment_on_copy(self, other: AppCommandT) -> AppCommandT:
if self._max_concurrency != other._max_concurrency:
# _max_concurrency won't be None at this point
other._max_concurrency = cast(MaxConcurrency, self._max_concurrency).copy()
if self.body != other.body:
other.body = copy(self.body)

try:
other.on_error = self.on_error
Expand Down