diff --git a/litecord/permissions.py b/litecord/permissions.py index 9b74d8e..654e2be 100644 --- a/litecord/permissions.py +++ b/litecord/permissions.py @@ -18,7 +18,7 @@ along with this program. If not, see . """ import ctypes -from typing import Optional +from typing import Optional, Union from quart import current_app as app @@ -77,8 +77,10 @@ class Permissions(ctypes.Union): _fields_ = [("bits", _RawPermsBits), ("binary", ctypes.c_uint64)] - def __init__(self, val: int): - self.binary = val + def __init__(self, val: Union[str, int]): + # always coerce to int, even when the user gives us a str, because + # python ints are infinity-sized (yes, yes, the memory concerns, yes) + self.binary = int(val) def __repr__(self): return f""