diff options
| author | Rapptz <[email protected]> | 2019-02-23 05:31:05 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-02-23 05:31:05 -0500 |
| commit | ac6e55353a7b1fea6619b5aef32506711350a7d2 (patch) | |
| tree | f9107b5997deea15d078109093d13eb50019441d | |
| parent | [commands] Pass over kwargs to `type.__new__` (diff) | |
| download | discord.py-ac6e55353a7b1fea6619b5aef32506711350a7d2.tar.xz discord.py-ac6e55353a7b1fea6619b5aef32506711350a7d2.zip | |
[commands] Copy on_error handlers in Command.copy
This fixes the issue of error handlers not applying.
| -rw-r--r-- | discord/ext/commands/core.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 4ac010e5..782b19ab 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -270,6 +270,10 @@ class Command(_BaseCommand): ret = self.__class__(self.callback, **self.__original_kwargs__) ret._before_invoke = self._before_invoke ret._after_invoke = self._after_invoke + try: + ret.on_error = self.on_error + except AttributeError: + pass return ret def _update_copy(self, kwargs): |