@@ -326,8 +326,10 @@ async def to_dict(self):
326326 "options" : selected .options or [],
327327 "default_permission" : selected .default_permission ,
328328 "permissions" : {},
329- "type" : 1 ,
329+ "type" : selected . _type ,
330330 }
331+ if command_dict ["type" ] != 1 :
332+ command_dict .pop ("description" )
331333 if y in selected .permissions :
332334 command_dict ["permissions" ][y ] = selected .permissions [y ]
333335 wait [y ][x ] = copy .deepcopy (command_dict )
@@ -340,8 +342,10 @@ async def to_dict(self):
340342 "options" : selected .options or [],
341343 "default_permission" : selected .default_permission ,
342344 "permissions" : selected .permissions or {},
343- "type" : 1 ,
345+ "type" : selected . _type ,
344346 }
347+ if command_dict ["type" ] != 1 :
348+ command_dict .pop ("description" )
345349 wait ["global" ][x ] = copy .deepcopy (command_dict )
346350
347351 # Separated normal command add and subcommand add not to
@@ -637,6 +641,18 @@ def add_slash_command(
637641 self .logger .debug (f"Added command `{ name } `" )
638642 return obj
639643
644+ def _cog_ext_add_context_menu (self , target : int , name : str , guild_ids : list = None ):
645+ """
646+ Creates a new cog_based context menu command.
647+
648+ :param cmd: Command Coroutine.
649+ :type cmd: Coroutine
650+ :param name: The name of the command
651+ :type name: str
652+ :param _type: The context menu type.
653+ :type _type: int
654+ """
655+
640656 def add_context_menu (self , cmd , name : str , _type : int , guild_ids : list = None ):
641657 """
642658 Creates a new context menu command.
0 commit comments