add repr to command

This commit is contained in:
Zomatree
2021-10-29 03:45:39 +01:00
parent a2168e35e9
commit 287b2d42ea
+4 -1
View File
@@ -17,7 +17,7 @@ __all__ = (
class Command:
"""Class for holding info about a command.
Parameters
-----------
callback: Callable[..., Coroutine[Any, Any, Any]]
@@ -79,6 +79,9 @@ class Command:
async def _error_handler(ctx: Context, error: Exception):
traceback.print_exception(type(error), error, error.__traceback__)
def __repr__(self) -> str:
return f"<Command name={self.name}>"
def command(*, name: Optional[str] = None, aliases: Optional[list[str]] = None, cls: type[Command] = Command):
"""Turns a function into a :class:`Command`.