From f5909e841438f6a0cbf6d3e3bb6e1c873061c75f Mon Sep 17 00:00:00 2001 From: Conatum Date: Tue, 26 Apr 2022 13:44:20 +0300 Subject: [PATCH] (interactions): Support callback extra `check`. --- bot/meta/interactions/components.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/meta/interactions/components.py b/bot/meta/interactions/components.py index 81f21145..d674d2ff 100644 --- a/bot/meta/interactions/components.py +++ b/bot/meta/interactions/components.py @@ -48,12 +48,12 @@ class AwaitableComponent: return await client.wait_for('interaction_create', timeout=timeout, check=_check) - def add_callback(self, timeout=None, repeat=True, pass_args=(), pass_kwargs={}): + def add_callback(self, timeout=None, repeat=True, check=None, pass_args=(), pass_kwargs={}): def wrapper(func): async def wrapped(): while True: try: - button_press = await self.wait_for(timeout=timeout) + button_press = await self.wait_for(timeout=timeout, check=check) except asyncio.TimeoutError: break asyncio.create_task(func(button_press, *pass_args, **pass_kwargs))