Repository: interactions-py/interactions.py

Issue:
default_permission doesn't have any effect
Hi,

Thanks a lot for this project!

I am trying to restrict the use of a command to a specific role using the following options, though it does not seem to have any effect:
```
    "default_permission": False,
    "permissions": {
        GUILD_ID : [ create_permission(ROLE_ID, SlashCommandPermissionType.ROLE, True) ]
    },
```
Other options I've tried that don't work:
- Only setting one "positive" permission to the role
- Setting one "negative" permission to the role `@everyone` and one positive to one role (the negative permission has no effect)
- Setting default_permission=False without anything else also has no effect.

The only way I can disallow a role/user to use it is by explicit adding a negative permission for them, meaning that for admin commands I would need to add a negative permission to all the guild users (because some users don't have roles).

I believe that's not the intended behavior and is a bug right?



Discussion:
I use this when I was testing the permission PR, and only user with id 281300452270931969 was able to run the command. From that little code snippet from you, its not enough to pin point any issue with your code tho.

```py
@slash.slash(name="test_guild", description="test_guild", default_permission=False, guild_ids=[750556940127436880, 823454213089787914], options=[create_option("test", "lol", SlashCommandOptionType.INTEGER, True)])
@slash.permission(823454213089787914, generate_permissions(allowed_users=[281300452270931969]))
async def test_guild(ctx, test):
    print(test)
    await ctx.send("test_guild")
```
So I investigated further. It looks like creating a command without adding `default_permission=False` the first time it is created and then adding it later has not effect.

I was able to go around the issue by temporarily renaming the command, adding the option and renaming it back to its original name.

Here is roughly the script I have, to give you more context, though I'm not sure if that helps.

```python
slash = SlashCommand(bot, sync_commands=True, delete_from_unused_guilds=True

slash.add_slash_command(
    name=BASE_COMMAND_NAME,
    cmd=_base_cmd,
    guild_ids=[GUILD_ID],
    options=[],
    default_permission=False,
    permissions={
        GUILD_ID: [
            create_permission(RESTRICTED_COMMANDS_ROLE_ID, SlashCommandPermissionType.ROLE, True)
        ]
    })
    
 slash.add_subcommand(base=BASE_COMMAND_NAME, **{
    "cmd": _some_function,
    "description": "description",
    "guild_ids": [GUILD_ID],
    "connector": {
        "utilisateur": "member"
    },
    "options": [
        {
            'name': 'utilisateur',
            'description': "Utilisateur à qui le message d'accueil sera envoyé",
            'type': SlashCommandOptionType.USER,
            'required': True
        }
    ]
})

```



Resolving patch:
diff --git a/discord_slash/model.py b/discord_slash/model.py
--- a/discord_slash/model.py
+++ b/discord_slash/model.py
@@ -70,16 +70,18 @@ class CommandData:
 
     :ivar name: Name of the command.
     :ivar description: Description of the command.
+    :ivar default_permission: Indicates whether users should have permissions to run this command by default.
     :ivar options: List of :class:`OptionData`.
     :ivar id: Command id, this is received from discord so may not be present
     :ivar application_id: The application id of the bot, required only when the application id and bot id are different. (old bots)
     """
 
     def __init__(
-            self, name, description, options=None, id=None, application_id=None, version=None, **kwargs
+            self, name, description, options=None, default_permission=True, id=None, application_id=None, version=None, **kwargs
     ):
         self.name = name
         self.description = description
+        self.default_permission = default_permission
         self.id = id
         self.application_id = application_id
         self.version = version
@@ -96,6 +98,7 @@ def __eq__(self, other):
                     self.name == other.name
                     and self.description == other.description
                     and self.options == other.options
+                    and self.default_permission == other.default_permission
             )
         else:
             return False


Test patch: