diff --git a/litecord/permissions.py b/litecord/permissions.py index 3825fe3..205e5be 100644 --- a/litecord/permissions.py +++ b/litecord/permissions.py @@ -75,7 +75,7 @@ class Permissions(ctypes.Union): The permissions value as an integer. """ - _fields_ = [("bits", _RawPermsBits), ("binary", ctypes.c_uint64)] + _fields_ = [("bits", _RawPermsBits), ("binary", ctypes.c_uint32)] def __init__(self, val: Union[str, int]): # always coerce to int, even when the user gives us a str, because diff --git a/tests/test_guild.py b/tests/test_guild.py index dd4a4f3..0a17666 100644 --- a/tests/test_guild.py +++ b/tests/test_guild.py @@ -150,3 +150,17 @@ async def test_prune_guild(test_cli_user): pruned_member_guild = await guild.refetch() assert pruned_member_guild.member_count == 1 + + +@pytest.mark.asyncio +async def test_guild_roles(test_cli_user): + guild = await test_cli_user.create_guild() + + resp = await test_cli_user.post( + f"/api/v6/guilds/{guild.id}/roles", + json={"name": "myrole", "permissions": -2043163063}, + ) + + assert resp.status_code == 200 + rjson = await resp.json + assert rjson["name"] == "myrole"