[commands] Copy on_error handlers in Command.copy

This fixes the issue of error handlers not applying.
This commit is contained in:
Rapptz 2019-02-23 05:31:05 -05:00
parent f15cf7c845
commit ac6e55353a

View File

@ -270,6 +270,10 @@ class Command(_BaseCommand):
ret = self.__class__(self.callback, **self.__original_kwargs__) ret = self.__class__(self.callback, **self.__original_kwargs__)
ret._before_invoke = self._before_invoke ret._before_invoke = self._before_invoke
ret._after_invoke = self._after_invoke ret._after_invoke = self._after_invoke
try:
ret.on_error = self.on_error
except AttributeError:
pass
return ret return ret
def _update_copy(self, kwargs): def _update_copy(self, kwargs):