diff --git a/discord/guild.py b/discord/guild.py index 8badf1239..fda921f94 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -3727,6 +3727,17 @@ class Guild(Hashable): else: fields['color'] = actual_colour.value + solid_color_used = color is not MISSING or colour is not MISSING + colors_used = ( + primary_color is not MISSING or + secondary_color is not MISSING or + tertiary_color is not MISSING + ) + if solid_color_used and colors_used: + raise TypeError( + "You must choose either only solid color (color/colour) or colors (primary_color/secondary_color/tertiary_color), not both." + ) + colors_payload: Dict[str, Any]= {} if primary_color is not MISSING: if primary_color is None: diff --git a/discord/role.py b/discord/role.py index 076b0b9f7..929d4446b 100644 --- a/discord/role.py +++ b/discord/role.py @@ -551,6 +551,17 @@ class Role(Hashable): if mentionable is not MISSING: payload['mentionable'] = mentionable + solid_color_used = color is not MISSING or colour is not MISSING + colors_used = ( + primary_color is not MISSING or + secondary_color is not MISSING or + tertiary_color is not MISSING + ) + if solid_color_used and colors_used: + raise TypeError( + "You must choose either only solid color (color/colour) or colors (primary_color/secondary_color/tertiary_color), not both." + ) + colors_payload: Dict[str, Any] = {} if primary_color is not MISSING: if primary_color is None: