Repository: Pycord-Development/pycord

Issue:
discord.Permissions.all() create/edit = 401 unauthorized
### Summary

discord.Permissions.all() seems to create something different or more than a manually created fully permissioned Permissions

### Reproduction Steps

My bot gets a 401 unauthorized error when trying to create or edit a role with a `discord.Permissions.all()` object, but will succeed when creating a blank `discord.Permissions()` object and using the `update()` method to set _all_ permissions to `True`

### Minimal Reproducible Code

```python
# fails 401 unauthorized
admin_permissions = discord.Permissions.all()
await self.bot.guild.create_role(
  name='Admin',
  permissions=admin_permissions,
)

# Succeeds
admin_permissions = discord.Permissions()
admin_permissions.update(
            add_reactions=True,
            administrator=True,
            attach_files=True,
            ban_members=True,
            change_nickname=True,
            connect=True,
            create_instant_invite=True,
            create_private_threads=True,
            create_public_threads=True,
            deafen_members=True,
            embed_links=True,
            external_emojis=True,
            external_stickers=True,
            kick_members=True,
            manage_channels=True,
            manage_emojis=True,
            manage_emojis_and_stickers=True,
            manage_events=True,
            manage_guild=True,
            manage_messages=True,
            manage_nicknames=True,
            manage_permissions=True,
            manage_roles=True,
            manage_threads=True,
            manage_webhooks=True,
            mention_everyone=True,
            moderate_members=True,
            move_members=True,
            mute_members=True,
            priority_speaker=True,
            read_message_history=True,
            read_messages=True,
            request_to_speak=True,
            send_messages=True,
            send_messages_in_threads=True,
            send_tts_messages=True,
            speak=True,
            start_embedded_activities=True,
            stream=True,
            use_application_commands=True,
            use_external_emojis=True,
            use_external_stickers=True,
            use_slash_commands=True,
            use_voice_activation=False,
            view_audit_log=True,
            view_channel=True,
            view_guild_insights=True,
)
await self.bot.guild.create_role(
  name='Admin',
  permissions=admin_permissions,
)
```


### Expected Results

using discord.Permissions.all() will create a fully permissioned Permissions object that can actually be created or edited without error.

### Actual Results

401 unauthorized

### Intents

All of them

### System Information

- Python v3.9.9-final
- py-cord v2.0.0-alpha
    - py-cord pkg_resources: v2.0.0a4757+g02e346db
- aiohttp v3.8.1
- system info: Linux 4.9.0-17-amd64 #1 SMP Debian 4.9.290-1 (2021-12-12)

### Checklist

- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.

### Additional Context

_No response_


Discussion:
Are you sure that your bot has the permission to set the permissions?
You need every permission you want to modify.
Except if you're an admin.

Check the role hierarchy too
Yeah I've given my bot administrator as I invite it to the server

It also has an administrator role
@Pycord-Development/official-contributors I think permissions all with the value `-1` was a bad idea
Certainly a bug! Having same issue

Resolving patch:
diff --git a/discord/permissions.py b/discord/permissions.py
--- a/discord/permissions.py
+++ b/discord/permissions.py
@@ -148,7 +148,7 @@ def all(cls: Type[P]) -> P:
         """A factory method that creates a :class:`Permissions` with all
         permissions set to ``True``.
         """
-        return cls(-1)
+        return cls(0b11111111111111111111111111111111111111111)
 
     @classmethod
     def all_channel(cls: Type[P]) -> P:


Test patch: