@@ -544,6 +544,7 @@ def get_guild_websocket(self, id: "Snowflake_Type") -> GatewayClient:
544544 def _sanity_check (self ) -> None :
545545 """Checks for possible and common errors in the bot's configuration."""
546546 self .logger .debug ("Running client sanity checks..." )
547+
547548 contexts = {
548549 self .interaction_context : InteractionContext ,
549550 self .component_context : ComponentContext ,
@@ -911,6 +912,11 @@ async def login(self, token: str | None = None) -> None:
911912 # so im gathering commands here
912913 self ._gather_callbacks ()
913914
915+ if any (v for v in constants .CLIENT_FEATURE_FLAGS .values ()):
916+ # list all enabled flags
917+ enabled_flags = [k for k , v in constants .CLIENT_FEATURE_FLAGS .items () if v ]
918+ self .logger .info (f"Enabled feature flags: { ', ' .join (enabled_flags )} " )
919+
914920 self .logger .debug ("Attempting to login" )
915921 me = await self .http .login (self .token )
916922 self ._user = ClientUser .from_dict (me , self )
@@ -1105,7 +1111,7 @@ async def wait_for_component(
11051111 dict ,
11061112 ]
11071113 ] = None ,
1108- check : Optional [Callable ] = None ,
1114+ check : Absent [ Optional [Union [ Callable [..., bool ], Callable [..., Awaitable [ bool ]]]] ] = None ,
11091115 timeout : Optional [float ] = None ,
11101116 ) -> "events.Component" :
11111117 """
@@ -1136,22 +1142,26 @@ async def wait_for_component(
11361142 if custom_ids and not all (isinstance (x , str ) for x in custom_ids ):
11371143 custom_ids = [str (i ) for i in custom_ids ]
11381144
1139- def _check (event : events .Component ) -> bool :
1145+ async def _check (event : events .Component ) -> bool :
11401146 ctx : ComponentContext = event .ctx
11411147 # if custom_ids is empty or there is a match
11421148 wanted_message = not message_ids or ctx .message .id in (
11431149 [message_ids ] if isinstance (message_ids , int ) else message_ids
11441150 )
11451151 wanted_component = not custom_ids or ctx .custom_id in custom_ids
11461152 if wanted_message and wanted_component :
1153+ if asyncio .iscoroutinefunction (check ):
1154+ return bool (check is None or await check (event ))
11471155 return bool (check is None or check (event ))
11481156 return False
11491157
11501158 return await self .wait_for ("component" , checks = _check , timeout = timeout )
11511159
11521160 def command (self , * args , ** kwargs ) -> Callable :
11531161 """A decorator that registers a command. Aliases `interactions.slash_command`"""
1154- raise NotImplementedError # TODO: implement
1162+ raise NotImplementedError (
1163+ "Use interactions.slash_command instead. Please consult the v4 -> v5 migration guide https://interactions-py.github.io/interactions.py/Guides/98%20Migration%20from%204.X/"
1164+ )
11551165
11561166 def listen (self , event_name : Absent [str ] = MISSING ) -> Callable [[AsyncCallable ], Listener ]:
11571167 """
0 commit comments