Skip to content

Commit 721dc58

Browse files
fractal13eightween
authored andcommitted
less overhead means to call a method with object binding
1 parent bb3b6b3 commit 721dc58

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

interactions/client/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,9 +1808,7 @@ async def _dispatch_interaction(self, event: RawGatewayEvent) -> None: # noqa:
18081808
if auto_opt := getattr(ctx, "focussed_option", None):
18091809
if autocomplete := ctx.command.autocomplete_callbacks.get(str(auto_opt.name)):
18101810
if ctx.command.has_binding:
1811-
callback = CallbackObject()
1812-
callback.callback = autocomplete
1813-
callback._binding = ctx.command._binding
1811+
callback = functools.partial(ctx.command.call_with_binding, autocomplete)
18141812
else:
18151813
callback = autocomplete
18161814
elif autocomplete := self._global_autocompletes.get(str(auto_opt.name)):

0 commit comments

Comments
 (0)