@@ -339,7 +339,6 @@ def add_slash_command(self,
339339 cmd ,
340340 name : str = None ,
341341 description : str = None ,
342- auto_convert : dict = None ,
343342 guild_ids : typing .List [int ] = None ,
344343 options : list = None ,
345344 has_subcommands : bool = False ):
@@ -352,8 +351,6 @@ def add_slash_command(self,
352351 :type name: str
353352 :param description: Description of the slash command. Defaults to command docstring or ``None``.
354353 :type description: str
355- :param auto_convert: Dictionary of how to convert option values. Default ``None``.
356- :type auto_convert: dict
357354 :param guild_ids: List of Guild ID of where the command will be used. Default ``None``, which will be global command.
358355 :type guild_ids: List[int]
359356 :param options: Options of the slash command. This will affect ``auto_convert`` and command data at Discord API. Default ``None``.
@@ -377,13 +374,9 @@ def add_slash_command(self,
377374 if options is None :
378375 options = manage_commands .generate_options (cmd , description )
379376
380- if options :
381- auto_convert = manage_commands .generate_auto_convert (options )
382-
383377 _cmd = {
384378 "func" : cmd ,
385379 "description" : description ,
386- "auto_convert" : auto_convert ,
387380 "guild_ids" : guild_ids ,
388381 "api_options" : options ,
389382 "has_subcommands" : has_subcommands
@@ -399,7 +392,6 @@ def add_subcommand(self,
399392 description : str = None ,
400393 base_description : str = None ,
401394 subcommand_group_description : str = None ,
402- auto_convert : dict = None ,
403395 guild_ids : typing .List [int ] = None ,
404396 options : list = None ):
405397 """
@@ -419,8 +411,6 @@ def add_subcommand(self,
419411 :type base_description: str
420412 :param subcommand_group_description: Description of the subcommand_group. Default ``None``.
421413 :type subcommand_group_description: str
422- :param auto_convert: Dictionary of how to convert option values. Default ``None``.
423- :type auto_convert: dict
424414 :param guild_ids: List of guild ID of where the command will be used. Default ``None``, which will be global command.
425415 :type guild_ids: List[int]
426416 :param options: Options of the subcommand. This will affect ``auto_convert`` and command data at Discord API. Default ``None``.
@@ -441,13 +431,9 @@ def add_subcommand(self,
441431 if options is None :
442432 options = manage_commands .generate_options (cmd , description )
443433
444- if options :
445- auto_convert = manage_commands .generate_auto_convert (options )
446-
447434 _cmd = {
448435 "func" : None ,
449436 "description" : base_description ,
450- "auto_convert" : {},
451437 "guild_ids" : guild_ids ,
452438 "api_options" : [],
453439 "has_subcommands" : True
@@ -458,7 +444,6 @@ def add_subcommand(self,
458444 "description" : description ,
459445 "base_desc" : base_description ,
460446 "sub_group_desc" : subcommand_group_description ,
461- "auto_convert" : auto_convert ,
462447 "guild_ids" : guild_ids ,
463448 "api_options" : options
464449 }
@@ -487,7 +472,6 @@ def slash(self,
487472 * ,
488473 name : str = None ,
489474 description : str = None ,
490- auto_convert : dict = None ,
491475 guild_id : int = None ,
492476 guild_ids : typing .List [int ] = None ,
493477 options : typing .List [dict ] = None ):
@@ -499,11 +483,11 @@ def slash(self,
499483 All args must be passed as keyword-args.
500484
501485 .. note::
502- Role, User, and Channel types are passed as id if you don't set ``auto_convert``, since API doesn't give type of the option for now. \n
503- Also, if ``options`` is passed, then ``auto_convert`` will be automatically created or overrided .
486+ If you don't pass `options` but has extra args, then it will automatically generate options.
487+ However, it is not recommended to use it since descriptions will be "No Description." or the command's description .
504488
505489 .. warning::
506- Unlike discord.py's command, ``*args``, keyword-only args, converters, etc. are NOT supported.
490+ Unlike discord.py's command, ``*args``, keyword-only args, converters, etc. are not supported or behave differently .
507491
508492 Example:
509493
@@ -518,21 +502,10 @@ async def _slash(ctx): # Normal usage.
518502 async def _pick(ctx, choice1, choice2): # Command with 1 or more args.
519503 await ctx.send(content=str(random.choice([choice1, choice2])))
520504
521- Example of formatting ``auto_convert``:
522-
523- .. code-block:: python
524-
525- {"option_role": "role", # For key put name of the option and for value put type of the option.
526- "option_user": SlashCommandOptionType.USER, # Also can use an enumeration member for the type
527- "option_user_two": 6, # or number
528- "option_channel": "CHANNEL"} # or upper case string.
529-
530505 :param name: Name of the slash command. Default name of the coroutine.
531506 :type name: str
532507 :param description: Description of the slash command. Default ``None``.
533508 :type description: str
534- :param auto_convert: Dictionary of how to convert option values. Default ``None``.
535- :type auto_convert: dict
536509 :param guild_id: Deprecated. Use ``guild_ids`` instead.
537510 :type guild_id: int
538511 :param guild_ids: List of Guild ID of where the command will be used. Default ``None``, which will be global command.
@@ -545,7 +518,7 @@ async def _pick(ctx, choice1, choice2): # Command with 1 or more args.
545518 guild_ids = [guild_id ]
546519
547520 def wrapper (cmd ):
548- self .add_slash_command (cmd , name , description , auto_convert , guild_ids , options )
521+ self .add_slash_command (cmd , name , description , guild_ids , options )
549522 return cmd
550523
551524 return wrapper
@@ -560,14 +533,20 @@ def subcommand(self,
560533 base_desc : str = None ,
561534 subcommand_group_description : str = None ,
562535 sub_group_desc : str = None ,
563- auto_convert : dict = None ,
564536 guild_ids : typing .List [int ] = None ,
565537 options : typing .List [dict ] = None ):
566538 """
567539 Decorator that registers subcommand.\n
568540 Unlike discord.py, you don't need base command.\n
569541 All args must be passed as keyword-args.
570542
543+ .. note::
544+ If you don't pass `options` but has extra args, then it will automatically generate options.
545+ However, it is not recommended to use it since descriptions will be "No Description." or the command's description.
546+
547+ .. warning::
548+ Unlike discord.py's command, ``*args``, keyword-only args, converters, etc. are not supported or behave differently.
549+
571550 Example:
572551
573552 .. code-block:: python
@@ -599,8 +578,6 @@ async def _group_kick_user(ctx, user):
599578 :param subcommand_group_description: Description of the subcommand_group. Default ``None``.
600579 :type subcommand_group_description: str
601580 :param sub_group_desc: Alias of ``subcommand_group_description``.
602- :param auto_convert: Dictionary of how to convert option values. Default ``None``.
603- :type auto_convert: dict
604581 :param guild_ids: List of guild ID of where the command will be used. Default ``None``, which will be global command.
605582 :type guild_ids: List[int]
606583 :param options: Options of the subcommand. This will affect ``auto_convert`` and command data at Discord API. Default ``None``.
@@ -610,7 +587,7 @@ async def _group_kick_user(ctx, user):
610587 subcommand_group_description = subcommand_group_description or sub_group_desc
611588
612589 def wrapper (cmd ):
613- self .add_subcommand (cmd , base , subcommand_group , name , description , base_description , subcommand_group_description , auto_convert , guild_ids , options )
590+ self .add_subcommand (cmd , base , subcommand_group , name , description , base_description , subcommand_group_description , guild_ids , options )
614591 return cmd
615592
616593 return wrapper
0 commit comments