@@ -507,21 +507,20 @@ def __init__(
507
507
self ._converter = None
508
508
self .channel_types : List [SlashCommandOptionType ] = kwargs .pop ("channel_types" , [])
509
509
if not isinstance (input_type , SlashCommandOptionType ):
510
- to_assign = input_type () if isinstance (input_type , type ) else input_type
511
- _type = SlashCommandOptionType .from_datatype (to_assign .__class__ )
512
- if _type == SlashCommandOptionType .custom :
513
- self ._converter = to_assign
510
+ if hasattr (input_type , "convert" ):
511
+ self ._converter = input_type
514
512
input_type = SlashCommandOptionType .string
515
- elif _type == SlashCommandOptionType .channel :
516
- if not isinstance (input_type , tuple ):
517
- input_type = (input_type ,)
518
- for i in input_type :
519
- if i .__name__ == 'GuildChannel' :
520
- continue
521
-
522
- channel_type = channel_type_map [i .__name__ ]
523
- self .channel_types .append (channel_type )
524
513
else :
514
+ _type = SlashCommandOptionType .from_datatype (input_type )
515
+ if _type == SlashCommandOptionType .channel :
516
+ if not isinstance (input_type , tuple ):
517
+ input_type = (input_type ,)
518
+ for i in input_type :
519
+ if i .__name__ == 'GuildChannel' :
520
+ continue
521
+
522
+ channel_type = channel_type_map [i .__name__ ]
523
+ self .channel_types .append (channel_type )
525
524
input_type = _type
526
525
self .input_type = input_type
527
526
self .required : bool = kwargs .pop ("required" , True )
0 commit comments