@@ -1164,24 +1164,22 @@ def __init__(self, description=None, *args, **options):
1164
1164
self .auto_sync_commands = options .get ("auto_sync_commands" , True )
1165
1165
1166
1166
self .debug_guilds = options .pop ("debug_guilds" , None )
1167
- self .default_command_contexts = set (
1168
- options .pop (
1167
+ self .default_command_contexts = options .pop (
1169
1168
"default_command_contexts" ,
1170
1169
{
1171
1170
InteractionContextType .guild ,
1172
1171
InteractionContextType .bot_dm ,
1173
1172
InteractionContextType .private_channel ,
1174
1173
},
1175
1174
)
1176
- )
1177
- self .default_command_integration_types = set (
1178
- options .pop (
1175
+
1176
+ self .default_command_integration_types = options .pop (
1179
1177
"default_command_integration_types" ,
1180
1178
{
1181
1179
IntegrationType .guild_install ,
1182
1180
},
1183
1181
)
1184
- )
1182
+
1185
1183
1186
1184
if self .owner_id and self .owner_ids :
1187
1185
raise TypeError ("Both owner_id and owner_ids are set." )
@@ -1192,6 +1190,20 @@ def __init__(self, description=None, *args, **options):
1192
1190
raise TypeError (
1193
1191
f"owner_ids must be a collection not { self .owner_ids .__class__ !r} "
1194
1192
)
1193
+ if not isinstance (
1194
+ self .default_command_contexts , collections .abc .Collection
1195
+ ):
1196
+ raise TypeError (
1197
+ f"default_command_contexts must be a collection not { self .default_command_contexts .__class__ !r} "
1198
+ )
1199
+ if not isinstance (
1200
+ self .default_command_integration_types , collections .abc .Collection
1201
+ ):
1202
+ raise TypeError (
1203
+ f"default_command_integration_types must be a collection not { self .default_command_integration_types .__class__ !r} "
1204
+ )
1205
+ self .default_command_contexts = set (self .default_command_contexts )
1206
+ self .default_command_integration_types = set (self .default_command_integration_types )
1195
1207
1196
1208
self ._checks = []
1197
1209
self ._check_once = []
@@ -1472,13 +1484,13 @@ class Bot(BotBase, Client):
1472
1484
:attr:`.process_application_commands` if the command is not found. Defaults to ``True``.
1473
1485
1474
1486
.. versionadded:: 2.0
1475
- default_command_contexts: Set [:class:`InteractionContextType`]
1487
+ default_command_contexts: Collection [:class:`InteractionContextType`]
1476
1488
The default context types that the bot will use for commands.
1477
1489
Defaults to a set containing :attr:`InteractionContextType.guild`, :attr:`InteractionContextType.bot_dm`, and
1478
1490
:attr:`InteractionContextType.private_channel`.
1479
1491
1480
1492
.. versionadded:: 2.6
1481
- default_command_integration_types: Set [:class:`IntegrationType`]
1493
+ default_command_integration_types: Collection [:class:`IntegrationType`] ]
1482
1494
The default integration types that the bot will use for commands.
1483
1495
Defaults to a set containing :attr:`IntegrationType.guild_install`.
1484
1496
0 commit comments