Repository: Rapptz/discord.py
File: discord/role.py (Python)

Code before:

        colors_payload: Dict[str, Any] = {}
        if primary_colour is not MISSING:
            if primary_colour is None:
                colors_payload['primary_color'] = None
            elif isinstance(primary_colour, int):
                colors_payload['primary_color'] = primary_colour
            else:
                colors_payload['primary_color'] = primary_colour.value
        if secondary_colour is not MISSING:
            if secondary_colour is None:
                colors_payload['secondary_color'] = None
            elif isinstance(secondary_colour, int):
                colors_payload['secondary_color'] = secondary_colour
            else:
                colors_payload['secondary_color'] = secondary_colour.value
        if tertiary_colour is not MISSING:
            if tertiary_colour is None:
                colors_payload['tertiary_color'] = None
            elif isinstance(tertiary_colour, int):
                colors_payload['tertiary_color'] = tertiary_colour
            else:
                colors_payload['tertiary_color'] = tertiary_colour.value
        if colors_payload:
            payload['colors'] = colors_payload

        data = await self._state.http.edit_role(self.guild.id, self.id, reason=reason, **payload)
        return Role(guild=self.guild, data=data, state=self._state)

    @overload
    async def move(self, *, beginning: bool, offset: int = ..., reason: Optional[str] = ...):
        ...

    @overload
    async def move(self, *, end: bool, offset: int = ..., reason: Optional[str] = ...):
        ...

    @overload
    async def move(self, *, above: Role, offset: int = ..., reason: Optional[str] = ...):
        ...

    @overload
    async def move(self, *, below: Role, offset: int = ..., reason: Optional[str] = ...):
        ...

    async def move(
        self,
        *,
        beginning: bool = MISSING,
        end: bool = MISSING,
        above: Role = MISSING,

Review comment (suggestion):
```suggestion
        colours = {
            'primary_color': payload['color'],
        }
        
        if actual_secondary_colour is not MISSING:
            if actual_secondary_colour is None:
                colours['secondary_color'] = None
            elif isinstance(actual_secondary_colour, int):
                colours['secondary_color'] = actual_secondary_colour
            else:
                colours['secondary_color'] = actual_secondary_colour.value
        if actual_tertiary_colour is not MISSING:
            if actual_tertiary_colour is None:
                colours['tertiary_color'] = None
            elif isinstance(actual_tertiary_colour, int):
                colours['tertiary_color'] = actual_tertiary_colour
            else:
                colours['tertiary_color'] = actual_tertiary_colour.value

        payload['colors'] = colours
```

Code after:
        data = await self._state.http.edit_role(self.guild.id, self.id, reason=reason, **payload)
        return Role(guild=self.guild, data=data, state=self._state)

    @overload
    async def move(self, *, beginning: bool, offset: int = ..., reason: Optional[str] = ...):
        ...

    @overload
    async def move(self, *, end: bool, offset: int = ..., reason: Optional[str] = ...):
        ...

    @overload
    async def move(self, *, above: Role, offset: int = ..., reason: Optional[str] = ...):
        ...

    @overload
    async def move(self, *, below: Role, offset: int = ..., reason: Optional[str] = ...):
        ...

    async def move(
        self,
        *,
        beginning: bool = MISSING,
        end: bool = MISSING,
        above: Role = MISSING,
        below: Role = MISSING,
        offset: int = 0,
        reason: Optional[str] = None,
    ):
        """|coro|

        A rich interface to help move a role relative to other roles.

        You must have :attr:`~discord.Permissions.manage_roles` to do this,
        and you cannot move roles above the client's top role in the guild.

        .. versionadded:: 2.5

        Parameters
        -----------
        beginning: :class:`bool`
            Whether to move this at the beginning of the role list, above the default role.
            This is mutually exclusive with `end`, `above`, and `below`.
        end: :class:`bool`
            Whether to move this at the end of the role list.
            This is mutually exclusive with `beginning`, `above`, and `below`.
        above: :class:`Role`
            The role that should be above our current role.
            This mutually exclusive with `beginning`, `end`, and `below`.
        below: :class:`Role`
            The role that should be below our current role.