diff --git a/discord/colour.py b/discord/colour.py index b8ee5dae8..9f1044513 100644 --- a/discord/colour.py +++ b/discord/colour.py @@ -46,13 +46,16 @@ class Colour: Attributes ------------ - value : int + value: int The raw integer colour value. """ __slots__ = ('value',) def __init__(self, value): + if not isinstance(value, int): + raise TypeError('Expected int parameter, received %s instead.' % value.__class__.__name__) + self.value = value def _get_byte(self, byte): diff --git a/discord/permissions.py b/discord/permissions.py index c8c8ae375..ee946ff60 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -69,6 +69,9 @@ class Permissions: __slots__ = ('value',) def __init__(self, permissions=0): + if not isinstance(permissions, int): + raise TypeError('Expected int parameter, received %s instead.' % permissions.__class__.__name__) + self.value = permissions def __eq__(self, other):