2828 Awaitable ,
2929 Tuple ,
3030 TypeVar ,
31+ cast ,
3132 overload ,
3233)
3334
9697 ComponentType ,
9798 Intents ,
9899 InteractionType ,
100+ IntegrationType ,
99101 Status ,
100102 MessageFlags ,
101103)
@@ -296,6 +298,7 @@ def __init__(
296298 component_context : Type [BaseContext ] = ComponentContext ,
297299 context_menu_context : Type [BaseContext ] = ContextMenuContext ,
298300 debug_scope : Absent ["Snowflake_Type" ] = MISSING ,
301+ default_integration_types : Absent [list [IntegrationType ]] = MISSING ,
299302 delete_unused_application_cmds : bool = False ,
300303 disable_dm_commands : bool = False ,
301304 enforce_interaction_perms : bool = True ,
@@ -356,6 +359,9 @@ def __init__(
356359 self .auto_defer = auto_defer
357360 """A system to automatically defer commands after a set duration"""
358361 self .intents = intents if isinstance (intents , Intents ) else Intents (intents )
362+ self .default_integration_types = cast (list [IntegrationType ], default_integration_types ) or [
363+ IntegrationType .GUILD_INSTALL
364+ ]
359365
360366 # resources
361367 if isinstance (proxy_auth , tuple ):
@@ -1364,7 +1370,7 @@ def add_listener(self, listener: Listener) -> None:
13641370 c_listener for c_listener in self .listeners [listener .event ] if not c_listener .is_default_listener
13651371 ]
13661372
1367- def add_interaction (self , command : InteractionCommand ) -> bool :
1373+ def add_interaction (self , command : InteractionCommand ) -> bool : # noqa: C901
13681374 """
13691375 Add a slash command to the client.
13701376
@@ -1378,6 +1384,9 @@ def add_interaction(self, command: InteractionCommand) -> bool:
13781384 if self .disable_dm_commands :
13791385 command .dm_permission = False
13801386
1387+ if not command .integration_types :
1388+ command .integration_types = list (self .default_integration_types )
1389+
13811390 # for SlashCommand objs without callback (like objects made to hold group info etc)
13821391 if command .callback is None :
13831392 return False
0 commit comments