Skip to content

Commit 28be549

Browse files
committed
Add command.parameters property
1 parent c709d91 commit 28be549

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

twitchio/ext/commands/core.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,15 @@ def _get_signature(self) -> None:
262262

263263
self._signature = help_sig
264264

265+
@property
266+
def parameters(self) -> MappingProxyType[str, inspect.Parameter]:
267+
"""Property returning a copy mapping of name to :class:`inspect.Parameter` pair, which are the parameters
268+
of the callback of this command, minus ``self`` (if in a class) and ``ctx``.
269+
270+
Can be used to retrieve the name, annotation, and default value of command parameters.
271+
"""
272+
return MappingProxyType(self._params)
273+
265274
@property
266275
def signature(self) -> str | None:
267276
"""Property returning an easily readable POSIX-like argument signature for the command.

0 commit comments

Comments
 (0)