Include Type on command obj enum + default values
@@ -309,13 +309,14 @@ class CommandObject(CallbackObject):
:ivar connector: Kwargs connector of the command.
"""
- def __init__(self, name, cmd): # Let's reuse old command formatting.
+ def __init__(self, name, cmd, type): # Let's reuse old command formatting.
super().__init__(cmd["func"])
self.name = name.lower()
self.description = cmd["description"]
self.allowed_guild_ids = cmd["guild_ids"] or []
self.options = cmd["api_options"] or []
self.connector = cmd["connector"] or {}
+ self.type = type or 1
class BaseCommandObject(CommandObject):
@@ -333,8 +334,8 @@ class BaseCommandObject(CommandObject):
:ivar permissions: Permissions to restrict use of this command.
"""
- def __init__(self, name, cmd): # Let's reuse old command formatting.
- super().__init__(name, cmd)
+ def __init__(self, name, cmd, type=1): # Let's reuse old command formatting.
+ super().__init__(name, cmd, type)
self.has_subcommands = cmd["has_subcommands"]
self.default_permission = cmd["default_permission"]
self.permissions = cmd["api_permissions"] or {}
@@ -698,6 +699,7 @@ class ButtonStyle(IntEnum):
success = 3
danger = 4
+
class ContextMenuType(IntEnum):
CHAT_INPUT = 1
USER = 2
