Skip to content

Commit a4e816a

Browse files
authored
Add __call__ to ApplicationCommand (#179)
1 parent fe4ee70 commit a4e816a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

discord/app/commands.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,16 @@ def __repr__(self):
104104
def __eq__(self, other):
105105
return isinstance(other, self.__class__)
106106

107+
async def __call__(self, ctx, *args, **kwargs):
108+
"""|coro|
109+
Calls the command's callback.
110+
111+
This method bypasses all checks that a command has and does not
112+
convert the arguments beforehand, so take care to pass the correct
113+
arguments in.
114+
"""
115+
return await self.callback(ctx, *args, **kwargs)
116+
107117
async def prepare(self, ctx: ApplicationContext) -> None:
108118
# This should be same across all 3 types
109119
ctx.command = self

0 commit comments

Comments
 (0)